first commit

This commit is contained in:
2026-02-22 00:15:25 +07:00
commit 39fc9e9e3f
25 changed files with 2116 additions and 0 deletions
+33
View File
@@ -0,0 +1,33 @@
-- name: ListForms :many
SELECT * FROM forms
WHERE user_id = $1
ORDER BY created_at DESC;
-- name: GetFormByID :one
SELECT * FROM forms
WHERE id = $1
LIMIT 1;
-- name: CreateForm :one
INSERT INTO forms (user_id, title, description)
VALUES ($1, $2, $3)
RETURNING *;
-- name: UpdateForm :one
UPDATE forms
SET title = $2,
description = $3,
updated_at = now()
WHERE id = $1
RETURNING *;
-- name: DeleteForm :exec
DELETE FROM forms
WHERE id = $1;
-- name: IncrementResponseCount :one
UPDATE forms
SET response_count = response_count + 1,
updated_at = now()
WHERE id = $1
RETURNING *;