update sqlc gen

This commit is contained in:
Pavel 2024-04-21 16:52:25 +03:00
parent b7afcb01b1
commit f056b6ffcc
2 changed files with 12 additions and 0 deletions

@ -849,3 +849,6 @@ ON CONFLICT (AmoID) DO NOTHING;
-- name: UpdateUsers :exec
UPDATE users SET Name = $2, Email = $3, Role = $4, "Group" = $5, AmoUserID = $6 WHERE AmoID = $1;
-- name: GetTokenById :exec
SELECT * FROM tokens WHERE accountID = $1;

@ -2116,6 +2116,15 @@ func (q *Queries) GetTagsWithPagination(ctx context.Context, arg GetTagsWithPagi
return items, nil
}
const getTokenById = `-- name: GetTokenById :exec
SELECT accountid, refreshtoken, accesstoken, authcode, expiration, createdat FROM tokens WHERE accountID = $1
`
func (q *Queries) GetTokenById(ctx context.Context, accountid string) error {
_, err := q.db.ExecContext(ctx, getTokenById, accountid)
return err
}
const getUsersWithPagination = `-- name: GetUsersWithPagination :many
SELECT id, accountid, amoid, name, email, role, "Group", deleted, createdat, subdomain, amouserid, country, COUNT(*) OVER() as total_count FROM users WHERE Deleted = false ORDER BY ID OFFSET ($1 - 1) * $2 LIMIT $2
`