don't use session
This commit is contained in:
@@ -67,21 +67,6 @@ func (q *Queries) CreateCustomer(ctx context.Context, arg CreateCustomerParams)
|
||||
return err
|
||||
}
|
||||
|
||||
const createNewSession = `-- name: CreateNewSession :exec
|
||||
INSERT INTO user_sessions (id, user_id, created_at) VALUES (?, ?, ?)
|
||||
`
|
||||
|
||||
type CreateNewSessionParams struct {
|
||||
ID string
|
||||
UserID string
|
||||
CreatedAt string
|
||||
}
|
||||
|
||||
func (q *Queries) CreateNewSession(ctx context.Context, arg CreateNewSessionParams) error {
|
||||
_, err := q.db.ExecContext(ctx, createNewSession, arg.ID, arg.UserID, arg.CreatedAt)
|
||||
return err
|
||||
}
|
||||
|
||||
const createUser = `-- name: CreateUser :exec
|
||||
INSERT INTO user (
|
||||
id
|
||||
@@ -151,15 +136,6 @@ func (q *Queries) CreateUser(ctx context.Context, arg CreateUserParams) error {
|
||||
return err
|
||||
}
|
||||
|
||||
const deleteSession = `-- name: DeleteSession :exec
|
||||
DELETE FROM user_sessions WHERE id = ?
|
||||
`
|
||||
|
||||
func (q *Queries) DeleteSession(ctx context.Context, id string) error {
|
||||
_, err := q.db.ExecContext(ctx, deleteSession, id)
|
||||
return err
|
||||
}
|
||||
|
||||
const getCustomer = `-- name: GetCustomer :one
|
||||
SELECT
|
||||
max_nkode_len
|
||||
@@ -201,17 +177,6 @@ func (q *Queries) GetCustomer(ctx context.Context, id string) (GetCustomerRow, e
|
||||
return i, err
|
||||
}
|
||||
|
||||
const getSession = `-- name: GetSession :one
|
||||
SELECT id, user_id, created_at FROM user_sessions WHERE user_id = ?
|
||||
`
|
||||
|
||||
func (q *Queries) GetSession(ctx context.Context, userID string) (UserSession, error) {
|
||||
row := q.db.QueryRowContext(ctx, getSession, userID)
|
||||
var i UserSession
|
||||
err := row.Scan(&i.ID, &i.UserID, &i.CreatedAt)
|
||||
return i, err
|
||||
}
|
||||
|
||||
const getSvgCount = `-- name: GetSvgCount :one
|
||||
SELECT COUNT(*) as count FROM svg_icon
|
||||
`
|
||||
|
||||
Reference in New Issue
Block a user