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:
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user