Files
2022-04-30 14:12:30 +02:00

22 lines
579 B
SQL

-- name: ListStats :many
SELECT id, name, description, weight, allowed_amounts FROM stat
WHERE scope_id = ?;
-- name: GetStat :one
SELECT id, name, description, weight, allowed_amounts FROM stat
WHERE scope_id = ? AND id = ?;
-- name: InsertStat :execresult
INSERT INTO stat (scope_id, name, description, weight, allowed_amounts)
VALUES (?, ?, ?, ?, ?);
-- name: UpdateStat :exec
UPDATE stat SET
name = ?,
description = ?,
weight = ?,
allowed_amounts = ?
WHERE id = ? AND scope_id = ?;
-- name: DeleteStat :exec
DELETE FROM stat WHERE id = ? AND scope_id = ?;