MCPcopy Index your code
hub / github.com/TanStack/db / buildToArrayQuery

Function buildToArrayQuery

packages/db/tests/query/includes.test.ts:1388–1404  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1386
1387 describe(`toArray`, () => {
1388 function buildToArrayQuery() {
1389 return createLiveQueryCollection((q) =>
1390 q.from({ p: projects }).select(({ p }) => ({
1391 id: p.id,
1392 name: p.name,
1393 issues: toArray(
1394 q
1395 .from({ i: issues })
1396 .where(({ i }) => eq(i.projectId, p.id))
1397 .select(({ i }) => ({
1398 id: i.id,
1399 title: i.title,
1400 })),
1401 ),
1402 })),
1403 )
1404 }
1405
1406 it(`produces arrays on parent rows, not Collections`, async () => {
1407 const collection = buildToArrayQuery()

Callers 1

includes.test.tsFile · 0.85

Calls 6

toArrayFunction · 0.85
selectMethod · 0.80
fromMethod · 0.80
whereMethod · 0.80
eqFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…