Merged in feature/testquery (pull request #39)

Test Query

* depstextandclean

* startedcleaningresult

* resulttidyup

* roundone

* cleaning

* unsyncedquery

* startedtestsandsimplification

* api

* querytests

* resultprocessortests

* unittests

* cleanup
This commit is contained in:
Michael McGuinness
2025-01-29 11:52:37 +00:00
parent c36b0cdcf8
commit 0ac5ff9e15
109 changed files with 2804 additions and 2100 deletions
+15
View File
@@ -4,9 +4,24 @@ SELECT id, config FROM queryConfigs where queryId = $1 and addedVersion >= $2 an
-- name: GetQuery :one
SELECT * FROM fullActiveQueries WHERE id = $1;
-- name: GetQueryWithVersion :one
SELECT DISTINCT q.id, q.type, q.activeVersion, q.latestVersion, coalesce(c.config, null) as config, ARRAY_AGG(DISTINCT r.requiredQueryId)::uuid[] as requiredIds
FROM queries AS q
LEFT JOIN queryConfigs AS c ON q.id = c.queryId
and $2 >= c.addedVersion
and $2 < COALESCE(c.removedVersion, $2 + 1)
LEFT JOIN requiredQueries AS r ON q.id = r.queryId
and $2 >= r.addedVersion
and $2 < COALESCE(r.removedVersion, $2 + 1)
WHERE q.id = $1
GROUP BY q.id, q.type, q.activeversion, q.latestversion, c.config;
-- name: ListQueries :many
SELECT * FROM fullActiveQueries;
-- name: ListQueriesById :many
SELECT * FROM fullActiveQueries WHERE id = any($1);
-- name: CreateQuery :one
INSERT INTO queries (type) VALUES ($1) RETURNING id;