update sqlc gen
This commit is contained in:
parent
afb94fcb49
commit
8957585976
@ -807,14 +807,27 @@ func (q *Queries) GetAccountWithPrivileges(ctx context.Context, userID sql.NullS
|
||||
}
|
||||
|
||||
const getAllAnswersByQuizID = `-- name: GetAllAnswersByQuizID :many
|
||||
SELECT DISTINCT ON(question_id) content, created_at, question_id, id FROM answer WHERE session = $1 AND start = false ORDER BY question_id ASC, created_at DESC
|
||||
SELECT DISTINCT ON (a.question_id)
|
||||
a.content, a.created_at, a.question_id, a.id, q.questiontype, quiz.qid
|
||||
FROM
|
||||
answer a
|
||||
JOIN
|
||||
question q ON a.question_id = q.id
|
||||
JOIN
|
||||
quiz ON q.quiz_id = quiz.id
|
||||
WHERE
|
||||
a.session = $1 AND a.start = false AND a.deleted = false
|
||||
ORDER BY
|
||||
a.question_id ASC, a.created_at DESC
|
||||
`
|
||||
|
||||
type GetAllAnswersByQuizIDRow struct {
|
||||
Content sql.NullString `db:"content" json:"content"`
|
||||
CreatedAt sql.NullTime `db:"created_at" json:"created_at"`
|
||||
QuestionID int64 `db:"question_id" json:"question_id"`
|
||||
ID int64 `db:"id" json:"id"`
|
||||
Content sql.NullString `db:"content" json:"content"`
|
||||
CreatedAt sql.NullTime `db:"created_at" json:"created_at"`
|
||||
QuestionID int64 `db:"question_id" json:"question_id"`
|
||||
ID int64 `db:"id" json:"id"`
|
||||
Questiontype interface{} `db:"questiontype" json:"questiontype"`
|
||||
Qid uuid.NullUUID `db:"qid" json:"qid"`
|
||||
}
|
||||
|
||||
func (q *Queries) GetAllAnswersByQuizID(ctx context.Context, session sql.NullString) ([]GetAllAnswersByQuizIDRow, error) {
|
||||
@ -831,6 +844,8 @@ func (q *Queries) GetAllAnswersByQuizID(ctx context.Context, session sql.NullStr
|
||||
&i.CreatedAt,
|
||||
&i.QuestionID,
|
||||
&i.ID,
|
||||
&i.Questiontype,
|
||||
&i.Qid,
|
||||
); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user