-- name: GetCollectorQueries :many
SELECT collectorId, queryId, type, queryVersion, ARRAY_AGG(requiredQueryId) AS requiredIds
    FROM collectorQueryDependencyTree
    WHERE collectorId = $1
    GROUP BY queryId, collectorId, type, queryVersion;

-- name: GetCollectorFromJobID :one
SELECT id, jobId, minCleanVersion, minTextVersion FROM collectors WHERE jobId = $1 LIMIT 1;