creatorupdatordeprecate

This commit is contained in:
Michael McGuinness
2025-01-03 13:41:07 +00:00
parent 0ac156f0e1
commit 788b21594c
36 changed files with 545 additions and 226 deletions
+11
View File
@@ -1,6 +1,17 @@
-- name: GetQueryConfig :one
SELECT id, config FROM queryConfigs where queryId = $1 and addedVersion >= $2 and COALESCE(removedVersion, $2 - 1) < $2;
-- name: GetQueryType :one
SELECT type FROM queries where id = $1;
-- name: DeprecateQuery :exec
INSERT INTO queryDeprecations (queryId) VALUES ($1) RETURNING id;
-- name: IsQueryDeprecated :one
SELECT EXISTS (
SELECT 1 FROM queryDeprecations where queryId = $1 and removedAt is not null
);
-- name: GetQuery :one
SELECT q.id, q.type, q.activeVersion, c.config, ARRAY_AGG(r.requiredQueryId) AS requiredIds
FROM queries AS q