()
| 528 | : false |
| 529 | |
| 530 | const getSelectExpr = (): string => { |
| 531 | if (!select) return "id, _etag, data" |
| 532 | const fields = select.map((s) => { |
| 533 | if (typeof s === "string") { |
| 534 | if (s === idKey || s === "id") return `id` |
| 535 | if (s === "_etag") return `_etag` |
| 536 | return `${dialect.jsonExtractJson(s)} AS "${s}"` |
| 537 | } |
| 538 | if ("computed" in s) { |
| 539 | return computedSelectExpr(s.key, s.computed) |
| 540 | } |
| 541 | if ("aggregate" in s) { |
| 542 | return aggregateSelectExpr(s.key, s.aggregate) |
| 543 | } |
| 544 | if ("path" in s) { |
| 545 | // Group-by fields: extract as scalar (not JSON-encoded) so grouping works and values compare as plain strings/numbers |
| 546 | return `${fieldExpr(dottedToJsonPath(s.path))} AS "${s.key}"` |
| 547 | } |
| 548 | return `${dialect.jsonExtractJson(s.key)} AS "${s.key}"` |
| 549 | }) |
| 550 | return fields.join(", ") |
| 551 | } |
| 552 | |
| 553 | // Order matters: projection params must be emitted BEFORE user-filter |
| 554 | // params so positional `?` placeholders in SQLite match `params[]` order. |
no test coverage detected
searching dependent graphs…