Skip to content

Commit

Permalink
format
Browse files Browse the repository at this point in the history
  • Loading branch information
JJTech0130 committed Jul 1, 2024
1 parent bfb826a commit 813ad69
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 9 deletions.
2 changes: 1 addition & 1 deletion pkg/store/container.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@ func newMetaSession(qh *dbutil.QueryHelper[*MetaSession]) *MetaSession {

func (c *Container) GetSessionQuery() *MetaSessionQuery {
return &MetaSessionQuery{dbutil.MakeQueryHelper(c.db, newMetaSession)}
}
}
13 changes: 7 additions & 6 deletions pkg/store/session_store.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,16 @@ import (
"database/sql"
"errors"

"go.mau.fi/util/dbutil"

"go.mau.fi/mautrix-meta/messagix/cookies"
"go.mau.fi/mautrix-meta/messagix/types"
"go.mau.fi/util/dbutil"
)

type MetaSession struct {
MetaID int64
WADeviceID uint16
Cookies *cookies.Cookies
MetaID int64
WADeviceID uint16
Cookies *cookies.Cookies
}

func (s *MetaSession) Scan(row dbutil.Scannable) (*MetaSession, error) {
Expand Down Expand Up @@ -52,8 +53,8 @@ func (s *MetaSession) Scan(row dbutil.Scannable) (*MetaSession, error) {
}

const (
getUserByMetaIDQuery = `SELECT meta_id, platform, wa_device_id, cookies FROM "meta_session" WHERE meta_id=$1`
insertUserQuery = `INSERT INTO "meta_session" (meta_id, platform, wa_device_id, cookies) VALUES ($1, $2, $3, $4)`
getUserByMetaIDQuery = `SELECT meta_id, platform, wa_device_id, cookies FROM "meta_session" WHERE meta_id=$1`
insertUserQuery = `INSERT INTO "meta_session" (meta_id, platform, wa_device_id, cookies) VALUES ($1, $2, $3, $4)`
)

type MetaSessionQuery struct {
Expand Down
2 changes: 1 addition & 1 deletion pkg/store/upgrades/00-latest.sql
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ CREATE TABLE meta_session (
-- platform must be "instagram" or "facebook"
CONSTRAINT platform_check CHECK (platform = 'instagram' OR platform = 'facebook'),
CONSTRAINT user_meta_id_unique UNIQUE(meta_id)
);
);
2 changes: 1 addition & 1 deletion pkg/store/upgrades/upgrades.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ var rawUpgrades embed.FS

func init() {
Table.RegisterFS(rawUpgrades)
}
}

0 comments on commit 813ad69

Please sign in to comment.