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

Function buildToArrayToArrayQuery

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

Source from the content-addressed store, hash-verified

1931
1932 describe(`nested includes: toArray → toArray`, () => {
1933 function buildToArrayToArrayQuery() {
1934 return createLiveQueryCollection((q) =>
1935 q.from({ p: projects }).select(({ p }) => ({
1936 id: p.id,
1937 name: p.name,
1938 issues: toArray(
1939 q
1940 .from({ i: issues })
1941 .where(({ i }) => eq(i.projectId, p.id))
1942 .select(({ i }) => ({
1943 id: i.id,
1944 title: i.title,
1945 comments: toArray(
1946 q
1947 .from({ c: comments })
1948 .where(({ c }) => eq(c.issueId, i.id))
1949 .select(({ c }) => ({
1950 id: c.id,
1951 body: c.body,
1952 })),
1953 ),
1954 })),
1955 ),
1956 })),
1957 )
1958 }
1959
1960 it(`initial load: both levels are arrays`, async () => {
1961 const collection = buildToArrayToArrayQuery()

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…