4ccb980593
Initial Job Collector (changes pending) * movearroundtocleancollector * internalgetfunctions * completecollectorquery * simplify * fixtests * addvendor * noplaceholder
14 lines
616 B
SQL
14 lines
616 B
SQL
CREATE VIEW collectorQueryDependencyTree AS
|
|
WITH RECURSIVE collectorQueryDependencyTree AS (
|
|
SELECT cq.id, aqc.id as queryId, aqc.type, aqc.requiredIds, aqc.activeVersion
|
|
FROM fullActiveQueries as aqc
|
|
JOIN activeCollectorsWithRequiredIDs as cq ON aqc.id = ANY(cq.queryIds)
|
|
|
|
UNION ALL
|
|
|
|
SELECT acq.id, q.id as queryId, q.type, q.requiredIds, q.activeVersion
|
|
FROM fullActiveQueries as q
|
|
JOIN collectorQueryDependencyTree as acq on q.id = ANY(acq.requiredIds)
|
|
)
|
|
SELECT id as collectorId, queryId, type, activeVersion as queryVersion, requiredIds::uuid[]
|
|
FROM collectorQueryDependencyTree; |