update sqlc gen
This commit is contained in:
parent
f3052eef0b
commit
17d5622ed1
@ -977,4 +977,4 @@ UPDATE utms AS u SET AmoFieldID = f.AmoID FROM fields AS f
|
||||
WHERE u.Name = f.Name AND u.ID = ANY($1::int[]) AND u.Deleted = FALSE;
|
||||
|
||||
-- name: GetQuestionListByIDs :many
|
||||
SELECT * FROM question WHERE id = ANY($1::int[]) AND deleted = FALSE
|
||||
SELECT * FROM question WHERE id = ANY($1::int[]) AND deleted = FALSE;
|
||||
|
@ -1771,6 +1771,47 @@ func (q *Queries) GetQuestionHistory(ctx context.Context, arg GetQuestionHistory
|
||||
return items, nil
|
||||
}
|
||||
|
||||
const getQuestionListByIDs = `-- name: GetQuestionListByIDs :many
|
||||
SELECT id, quiz_id, title, description, questiontype, required, deleted, page, content, version, parent_ids, created_at, updated_at FROM question WHERE id = ANY($1::int[]) AND deleted = FALSE
|
||||
`
|
||||
|
||||
func (q *Queries) GetQuestionListByIDs(ctx context.Context, dollar_1 []int32) ([]Question, error) {
|
||||
rows, err := q.db.QueryContext(ctx, getQuestionListByIDs, pq.Array(dollar_1))
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
defer rows.Close()
|
||||
var items []Question
|
||||
for rows.Next() {
|
||||
var i Question
|
||||
if err := rows.Scan(
|
||||
&i.ID,
|
||||
&i.QuizID,
|
||||
&i.Title,
|
||||
&i.Description,
|
||||
&i.Questiontype,
|
||||
&i.Required,
|
||||
&i.Deleted,
|
||||
&i.Page,
|
||||
&i.Content,
|
||||
&i.Version,
|
||||
pq.Array(&i.ParentIds),
|
||||
&i.CreatedAt,
|
||||
&i.UpdatedAt,
|
||||
); 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 getQuestionTitle = `-- name: GetQuestionTitle :one
|
||||
SELECT title, questiontype,page FROM question WHERE id = $1
|
||||
`
|
||||
|
Loading…
Reference in New Issue
Block a user