sqlc gen
This commit is contained in:
parent
554d93283c
commit
d27fa4798a
@ -1,6 +1,6 @@
|
|||||||
// Code generated by sqlc. DO NOT EDIT.
|
// Code generated by sqlc. DO NOT EDIT.
|
||||||
// versions:
|
// versions:
|
||||||
// sqlc v1.28.0
|
// sqlc v1.29.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.28.0
|
// sqlc v1.29.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.28.0
|
// sqlc v1.29.0
|
||||||
// source: queries.sql
|
// source: queries.sql
|
||||||
|
|
||||||
package sqlcgen
|
package sqlcgen
|
||||||
@ -3002,7 +3002,7 @@ func (q *Queries) GetQuestionTitle(ctx context.Context, id int64) (GetQuestionTi
|
|||||||
}
|
}
|
||||||
|
|
||||||
const getQuestions = `-- name: GetQuestions :many
|
const getQuestions = `-- name: GetQuestions :many
|
||||||
SELECT id, quiz_id, title, description, questiontype, required, deleted, page, content, version, parent_ids, created_at, updated_at FROM question WHERE quiz_id = $1 AND deleted = FALSE ORDER BY page ASC
|
SELECT id, quiz_id, title, description, questiontype, required, deleted, page, content, version, parent_ids, created_at, updated_at,auditory FROM question WHERE quiz_id = $1 AND deleted = FALSE ORDER BY page ASC
|
||||||
`
|
`
|
||||||
|
|
||||||
type GetQuestionsRow struct {
|
type GetQuestionsRow struct {
|
||||||
@ -3019,6 +3019,7 @@ type GetQuestionsRow struct {
|
|||||||
ParentIds []int32 `db:"parent_ids" json:"parent_ids"`
|
ParentIds []int32 `db:"parent_ids" json:"parent_ids"`
|
||||||
CreatedAt sql.NullTime `db:"created_at" json:"created_at"`
|
CreatedAt sql.NullTime `db:"created_at" json:"created_at"`
|
||||||
UpdatedAt sql.NullTime `db:"updated_at" json:"updated_at"`
|
UpdatedAt sql.NullTime `db:"updated_at" json:"updated_at"`
|
||||||
|
Auditory int64 `db:"auditory" json:"auditory"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (q *Queries) GetQuestions(ctx context.Context, quizID int64) ([]GetQuestionsRow, error) {
|
func (q *Queries) GetQuestions(ctx context.Context, quizID int64) ([]GetQuestionsRow, error) {
|
||||||
@ -3044,6 +3045,7 @@ func (q *Queries) GetQuestions(ctx context.Context, quizID int64) ([]GetQuestion
|
|||||||
pq.Array(&i.ParentIds),
|
pq.Array(&i.ParentIds),
|
||||||
&i.CreatedAt,
|
&i.CreatedAt,
|
||||||
&i.UpdatedAt,
|
&i.UpdatedAt,
|
||||||
|
&i.Auditory,
|
||||||
); err != nil {
|
); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
@ -3059,7 +3061,7 @@ func (q *Queries) GetQuestions(ctx context.Context, quizID int64) ([]GetQuestion
|
|||||||
}
|
}
|
||||||
|
|
||||||
const getQuestionsAI = `-- name: GetQuestionsAI :many
|
const getQuestionsAI = `-- name: GetQuestionsAI :many
|
||||||
SELECT q.id, q.quiz_id, q.title, q.description, q.questiontype, q.required, q.deleted, q.page, q.content, q.version, q.parent_ids, q.created_at, q.updated_at, q.session FROM question q
|
SELECT q.id, q.quiz_id, q.title, q.description, q.questiontype, q.required, q.deleted, q.page, q.content, q.version, q.parent_ids, q.created_at, q.updated_at, q.session,q.auditory FROM question q
|
||||||
WHERE q.quiz_id = $1 AND (q.session = $2 OR q.session = '') AND q.deleted = FALSE
|
WHERE q.quiz_id = $1 AND (q.session = $2 OR q.session = '') AND q.deleted = FALSE
|
||||||
ORDER BY (q.session != '') ASC, --без сессии первые потом с сессией
|
ORDER BY (q.session != '') ASC, --без сессии первые потом с сессией
|
||||||
q.page, --по возрастанию страницы
|
q.page, --по возрастанию страницы
|
||||||
@ -3074,24 +3076,7 @@ type GetQuestionsAIParams struct {
|
|||||||
Offset int32 `db:"offset" json:"offset"`
|
Offset int32 `db:"offset" json:"offset"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type GetQuestionsAIRow struct {
|
func (q *Queries) GetQuestionsAI(ctx context.Context, arg GetQuestionsAIParams) ([]Question, error) {
|
||||||
ID int64 `db:"id" json:"id"`
|
|
||||||
QuizID int64 `db:"quiz_id" json:"quiz_id"`
|
|
||||||
Title string `db:"title" json:"title"`
|
|
||||||
Description sql.NullString `db:"description" json:"description"`
|
|
||||||
Questiontype interface{} `db:"questiontype" json:"questiontype"`
|
|
||||||
Required sql.NullBool `db:"required" json:"required"`
|
|
||||||
Deleted sql.NullBool `db:"deleted" json:"deleted"`
|
|
||||||
Page sql.NullInt16 `db:"page" json:"page"`
|
|
||||||
Content sql.NullString `db:"content" json:"content"`
|
|
||||||
Version sql.NullInt16 `db:"version" json:"version"`
|
|
||||||
ParentIds []int32 `db:"parent_ids" json:"parent_ids"`
|
|
||||||
CreatedAt sql.NullTime `db:"created_at" json:"created_at"`
|
|
||||||
UpdatedAt sql.NullTime `db:"updated_at" json:"updated_at"`
|
|
||||||
Session string `db:"session" json:"session"`
|
|
||||||
}
|
|
||||||
|
|
||||||
func (q *Queries) GetQuestionsAI(ctx context.Context, arg GetQuestionsAIParams) ([]GetQuestionsAIRow, error) {
|
|
||||||
rows, err := q.db.QueryContext(ctx, getQuestionsAI,
|
rows, err := q.db.QueryContext(ctx, getQuestionsAI,
|
||||||
arg.QuizID,
|
arg.QuizID,
|
||||||
arg.Session,
|
arg.Session,
|
||||||
@ -3102,9 +3087,9 @@ func (q *Queries) GetQuestionsAI(ctx context.Context, arg GetQuestionsAIParams)
|
|||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
defer rows.Close()
|
defer rows.Close()
|
||||||
var items []GetQuestionsAIRow
|
var items []Question
|
||||||
for rows.Next() {
|
for rows.Next() {
|
||||||
var i GetQuestionsAIRow
|
var i Question
|
||||||
if err := rows.Scan(
|
if err := rows.Scan(
|
||||||
&i.ID,
|
&i.ID,
|
||||||
&i.QuizID,
|
&i.QuizID,
|
||||||
@ -3120,6 +3105,7 @@ func (q *Queries) GetQuestionsAI(ctx context.Context, arg GetQuestionsAIParams)
|
|||||||
&i.CreatedAt,
|
&i.CreatedAt,
|
||||||
&i.UpdatedAt,
|
&i.UpdatedAt,
|
||||||
&i.Session,
|
&i.Session,
|
||||||
|
&i.Auditory,
|
||||||
); err != nil {
|
); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user