()
| 422 | } |
| 423 | |
| 424 | const buildSelectList = (): string => { |
| 425 | if (!select) return "f" |
| 426 | return select |
| 427 | .map((s) => { |
| 428 | if (typeof s === "string") { |
| 429 | return dottedToAccess(s === idKey ? "f.id" : `f.${s}`) |
| 430 | } |
| 431 | if ("computed" in s) return computedSelectExpr(s.key, s.computed) |
| 432 | if ("aggregate" in s) return aggregateSelectExpr(s.key, s.aggregate) |
| 433 | if ("path" in s) return `${dottedToAccess(`f.${s.path}`)} AS ${s.key}` |
| 434 | // subKeys |
| 435 | return `ARRAY (SELECT ${s.subKeys.map((_) => dottedToAccess(`t.${_}`)).join(",")} |
| 436 | FROM t in ${dottedToAccess(`f.${s.key}`)}) AS ${s.key}` |
| 437 | }) |
| 438 | .join(", ") |
| 439 | } |
| 440 | |
| 441 | const groupByClause = hasAggregates && select |
| 442 | ? (() => { |
no test coverage detected
searching dependent graphs…