MCPcopy Create free account
hub / github.com/effect-app/libs / buildSelectList

Function buildSelectList

packages/infra/src/Store/Cosmos/query.ts:424–439  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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 ? (() => {

Callers 1

buildWhereCosmosQuery3Function · 0.85

Calls 5

dottedToAccessFunction · 0.85
joinMethod · 0.80
computedSelectExprFunction · 0.70
aggregateSelectExprFunction · 0.70
mapMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…