update sqlc gen files
This commit is contained in:
parent
aadccd6571
commit
7bb41cca01
@ -35,6 +35,7 @@ type Answer struct {
|
||||
Os string `db:"os" json:"os"`
|
||||
Browser string `db:"browser" json:"browser"`
|
||||
Ip string `db:"ip" json:"ip"`
|
||||
Start bool `db:"start" json:"start"`
|
||||
}
|
||||
|
||||
type Privilege struct {
|
||||
|
@ -91,7 +91,7 @@ func (q *Queries) CheckAndAddDefault(ctx context.Context, arg CheckAndAddDefault
|
||||
}
|
||||
|
||||
const checkResultOwner = `-- name: CheckResultOwner :one
|
||||
SELECT q.accountid FROM answer a JOIN quiz q ON a.quiz_id = q.id WHERE a.id = $1 AND a.deleted = FALSE
|
||||
SELECT q.accountid FROM answer a JOIN quiz q ON a.quiz_id = q.id WHERE a.id = $1 AND a.deleted = FALSE AND a.start = false
|
||||
`
|
||||
|
||||
func (q *Queries) CheckResultOwner(ctx context.Context, id int64) (string, error) {
|
||||
@ -105,7 +105,7 @@ const checkResultsOwner = `-- name: CheckResultsOwner :many
|
||||
SELECT a.id
|
||||
FROM answer a
|
||||
JOIN quiz q ON a.quiz_id = q.id
|
||||
WHERE a.id = ANY($1::bigint[]) AND a.deleted = FALSE AND q.accountid = $2
|
||||
WHERE a.id = ANY($1::bigint[]) AND a.deleted = FALSE AND q.accountid = $2 AND a.start = false
|
||||
`
|
||||
|
||||
type CheckResultsOwnerParams struct {
|
||||
@ -476,7 +476,7 @@ 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 ORDER BY question_id ASC, created_at DESC
|
||||
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
|
||||
`
|
||||
|
||||
type GetAllAnswersByQuizIDRow struct {
|
||||
@ -985,7 +985,7 @@ func (q *Queries) GetQuizHistory(ctx context.Context, arg GetQuizHistoryParams)
|
||||
|
||||
const getResultAnswers = `-- name: GetResultAnswers :many
|
||||
SELECT DISTINCT on (question_id) id, content, quiz_id, question_id, fingerprint, session,created_at, result, new,deleted FROM answer WHERE session = (
|
||||
SELECT session FROM answer WHERE answer.id = $1) ORDER BY question_id, created_at DESC
|
||||
SELECT session FROM answer WHERE answer.id = $1) AND start = false ORDER BY question_id, created_at DESC
|
||||
`
|
||||
|
||||
type GetResultAnswersRow struct {
|
||||
@ -1048,8 +1048,9 @@ INSERT INTO answer(
|
||||
device,
|
||||
os,
|
||||
browser,
|
||||
ip
|
||||
) VALUES ($1,$2,$3,$4,$5,$6,$7,$8,$9,$10,$11,$12)
|
||||
ip,
|
||||
start
|
||||
) VALUES ($1,$2,$3,$4,$5,$6,$7,$8,$9,$10,$11,$12,$13)
|
||||
`
|
||||
|
||||
type InsertAnswersParams struct {
|
||||
@ -1065,6 +1066,7 @@ type InsertAnswersParams struct {
|
||||
Os string `db:"os" json:"os"`
|
||||
Browser string `db:"browser" json:"browser"`
|
||||
Ip string `db:"ip" json:"ip"`
|
||||
Start bool `db:"start" json:"start"`
|
||||
}
|
||||
|
||||
func (q *Queries) InsertAnswers(ctx context.Context, arg InsertAnswersParams) error {
|
||||
@ -1081,6 +1083,7 @@ func (q *Queries) InsertAnswers(ctx context.Context, arg InsertAnswersParams) er
|
||||
arg.Os,
|
||||
arg.Browser,
|
||||
arg.Ip,
|
||||
arg.Start,
|
||||
)
|
||||
return err
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user