update sqlc gen
This commit is contained in:
parent
df09740009
commit
4c6b21e7f0
@ -1720,6 +1720,46 @@ func (q *Queries) GetFieldsWithPagination(ctx context.Context, arg GetFieldsWith
|
|||||||
return items, nil
|
return items, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const getLeadTarget = `-- name: GetLeadTarget :many
|
||||||
|
SELECT id, accountid, type, quizid, target, deleted, createdat FROM leadtarget WHERE accountID = $1 AND quizID = $2 AND deleted=false
|
||||||
|
`
|
||||||
|
|
||||||
|
type GetLeadTargetParams struct {
|
||||||
|
Accountid string `db:"accountid" json:"accountid"`
|
||||||
|
Quizid int32 `db:"quizid" json:"quizid"`
|
||||||
|
}
|
||||||
|
|
||||||
|
func (q *Queries) GetLeadTarget(ctx context.Context, arg GetLeadTargetParams) ([]Leadtarget, error) {
|
||||||
|
rows, err := q.db.QueryContext(ctx, getLeadTarget, arg.Accountid, arg.Quizid)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
defer rows.Close()
|
||||||
|
var items []Leadtarget
|
||||||
|
for rows.Next() {
|
||||||
|
var i Leadtarget
|
||||||
|
if err := rows.Scan(
|
||||||
|
&i.ID,
|
||||||
|
&i.Accountid,
|
||||||
|
&i.Type,
|
||||||
|
&i.Quizid,
|
||||||
|
&i.Target,
|
||||||
|
&i.Deleted,
|
||||||
|
&i.Createdat,
|
||||||
|
); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
items = append(items, i)
|
||||||
|
}
|
||||||
|
if err := rows.Close(); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
if err := rows.Err(); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return items, nil
|
||||||
|
}
|
||||||
|
|
||||||
const getListCreatedQuizzes = `-- name: GetListCreatedQuizzes :many
|
const getListCreatedQuizzes = `-- name: GetListCreatedQuizzes :many
|
||||||
SELECT id
|
SELECT id
|
||||||
FROM quiz
|
FROM quiz
|
||||||
|
Loading…
Reference in New Issue
Block a user