add new varible to getting question title

This commit is contained in:
Pavel 2024-04-16 14:07:18 +03:00
parent a84f95429f
commit 6e6e28d492
4 changed files with 9 additions and 8 deletions

@ -171,7 +171,7 @@ WHERE
qid = $1; qid = $1;
-- name: GetQuestionTitle :one -- name: GetQuestionTitle :one
SELECT title, questiontype FROM question WHERE id = $1; SELECT title, questiontype,page FROM question WHERE id = $1;
-- name: WorkerTimeoutProcess :exec -- name: WorkerTimeoutProcess :exec
UPDATE quiz SET status = 'timeout' WHERE deleted = false AND due_to <> 0 AND due_to < EXTRACT(epoch FROM CURRENT_TIMESTAMP); UPDATE quiz SET status = 'timeout' WHERE deleted = false AND due_to <> 0 AND due_to < EXTRACT(epoch FROM CURRENT_TIMESTAMP);

@ -1,6 +1,6 @@
// Code generated by sqlc. DO NOT EDIT. // Code generated by sqlc. DO NOT EDIT.
// versions: // versions:
// sqlc v1.25.0 // sqlc v1.26.0
package sqlcgen package sqlcgen

@ -1,6 +1,6 @@
// Code generated by sqlc. DO NOT EDIT. // Code generated by sqlc. DO NOT EDIT.
// versions: // versions:
// sqlc v1.25.0 // sqlc v1.26.0
package sqlcgen package sqlcgen

@ -1,6 +1,6 @@
// Code generated by sqlc. DO NOT EDIT. // Code generated by sqlc. DO NOT EDIT.
// versions: // versions:
// sqlc v1.25.0 // sqlc v1.26.0
// source: queries.sql // source: queries.sql
package sqlcgen package sqlcgen
@ -1102,18 +1102,19 @@ func (q *Queries) GetQuestionHistory(ctx context.Context, arg GetQuestionHistory
} }
const getQuestionTitle = `-- name: GetQuestionTitle :one const getQuestionTitle = `-- name: GetQuestionTitle :one
SELECT title, questiontype FROM question WHERE id = $1 SELECT title, questiontype,page FROM question WHERE id = $1
` `
type GetQuestionTitleRow struct { type GetQuestionTitleRow struct {
Title string `db:"title" json:"title"` Title string `db:"title" json:"title"`
Questiontype interface{} `db:"questiontype" json:"questiontype"` Questiontype interface{} `db:"questiontype" json:"questiontype"`
Page sql.NullInt16 `db:"page" json:"page"`
} }
func (q *Queries) GetQuestionTitle(ctx context.Context, id int64) (GetQuestionTitleRow, error) { func (q *Queries) GetQuestionTitle(ctx context.Context, id int64) (GetQuestionTitleRow, error) {
row := q.db.QueryRowContext(ctx, getQuestionTitle, id) row := q.db.QueryRowContext(ctx, getQuestionTitle, id)
var i GetQuestionTitleRow var i GetQuestionTitleRow
err := row.Scan(&i.Title, &i.Questiontype) err := row.Scan(&i.Title, &i.Questiontype, &i.Page)
return i, err return i, err
} }