(from: QueryIR[`from`])
| 1327 | } |
| 1328 | |
| 1329 | function collectFromAliases(from: QueryIR[`from`]): Array<string> { |
| 1330 | if (from.type === `unionFrom`) { |
| 1331 | return from.sources.map((source) => source.alias) |
| 1332 | } |
| 1333 | |
| 1334 | if (from.type === `unionAll`) { |
| 1335 | return from.queries.flatMap((branch) => collectQueryAliases(branch)) |
| 1336 | } |
| 1337 | |
| 1338 | return [from.alias] |
| 1339 | } |
| 1340 | |
| 1341 | /** |
| 1342 | * Checks if two eq() arguments form a parent-child correlation. |
no test coverage detected