-- name: ListConfigOverrides :many
SELECT key, value, updated_by, updated_at
FROM core.integration_config_overrides
ORDER BY key;

-- name: UpsertConfigOverride :exec
INSERT INTO core.integration_config_overrides (key, value, updated_by)
VALUES ($1, $2, $3)
ON CONFLICT (key) DO UPDATE
SET value = EXCLUDED.value, updated_by = EXCLUDED.updated_by, updated_at = NOW();

-- name: DeleteConfigOverride :execrows
DELETE FROM core.integration_config_overrides
WHERE key = $1;
