-- name: InsertGlobalSetting :exec
INSERT INTO global_settings (key, value)
VALUES ($1, $2) ON CONFLICT (key) DO
UPDATE
SET value = EXCLUDED.value;
-- name: GetGlobalSettings :many
SELECT *
FROM global_settings;
-- name: GetGlobalSetting :one
SELECT *
FROM global_settings
WHERE key = $1;
-- name: UpdateGlobalSetting :exec
UPDATE global_settings
SET value = $2,
    updated_at = CURRENT_TIMESTAMP
WHERE key = $1;
