update sqlc gen
This commit is contained in:
parent
0c30ce306d
commit
6ff56437fd
@ -1067,5 +1067,5 @@ SELECT ID,AccountID,AmoID,Name,Email,Role,"Group",Subdomain,AmoUserID,Country
|
||||
FROM users
|
||||
WHERE AmoUserID = $1 AND Deleted = false;
|
||||
|
||||
--name: GetFieldByAmoID :one
|
||||
-- name: GetFieldByAmoID :one
|
||||
SELECT * FROM fields WHERE AmoID = $1 AND Deleted = false;
|
||||
|
@ -1532,6 +1532,27 @@ func (q *Queries) GetExpiredPrivilege(ctx context.Context, privilegeid sql.NullS
|
||||
return items, nil
|
||||
}
|
||||
|
||||
const getFieldByAmoID = `-- name: GetFieldByAmoID :one
|
||||
SELECT id, amoid, code, accountid, name, entity, type, deleted, createdat FROM fields WHERE AmoID = $1 AND Deleted = false
|
||||
`
|
||||
|
||||
func (q *Queries) GetFieldByAmoID(ctx context.Context, amoid int32) (Field, error) {
|
||||
row := q.db.QueryRowContext(ctx, getFieldByAmoID, amoid)
|
||||
var i Field
|
||||
err := row.Scan(
|
||||
&i.ID,
|
||||
&i.Amoid,
|
||||
&i.Code,
|
||||
&i.Accountid,
|
||||
&i.Name,
|
||||
&i.Entity,
|
||||
&i.Type,
|
||||
&i.Deleted,
|
||||
&i.Createdat,
|
||||
)
|
||||
return i, err
|
||||
}
|
||||
|
||||
const getFieldsWithPagination = `-- name: GetFieldsWithPagination :many
|
||||
SELECT f.id, f.amoid, f.code, f.accountid, f.name, f.entity, f.type, f.deleted, f.createdat, COUNT(*) OVER() as total_count
|
||||
FROM fields f JOIN (SELECT AmoID FROM users WHERE users.AccountID = $1) u ON f.AccountID = u.AmoID
|
||||
|
Loading…
Reference in New Issue
Block a user