39 lines
714 B
SQL
39 lines
714 B
SQL
-- name: GetQuestionListByIDs :many
|
|
SELECT * FROM question WHERE id = ANY($1::int[]) AND deleted = FALSE;
|
|
|
|
-- name: InsertQuestion :one
|
|
INSERT INTO question (
|
|
quiz_id,
|
|
title,
|
|
description,
|
|
questiontype,
|
|
required,
|
|
page,
|
|
content,
|
|
parent_ids,
|
|
updated_at,
|
|
session,
|
|
auditory
|
|
)
|
|
VALUES ($1,$2,$3,$4,$5,$6,$7,$8,$9,$10,$11)
|
|
RETURNING id, created_at, updated_at;
|
|
|
|
-- name: InsertAnswers :one
|
|
INSERT INTO answer(
|
|
content,
|
|
quiz_id,
|
|
question_id,
|
|
fingerprint,
|
|
session,
|
|
result,
|
|
email,
|
|
device_type,
|
|
device,
|
|
os,
|
|
browser,
|
|
ip,
|
|
start,
|
|
utm,
|
|
version
|
|
) VALUES ($1,$2,$3,$4,$5,$6,$7,$8,$9,$10,$11,$12,$13,$14,$15)
|
|
RETURNING *; |