()
| 3869 | describe(`aggregates in child queries`, () => { |
| 3870 | describe(`single-group aggregate: count issues per project (as Collection)`, () => { |
| 3871 | function buildAggregateQuery() { |
| 3872 | return createLiveQueryCollection((q) => |
| 3873 | q.from({ p: projects }).select(({ p }) => ({ |
| 3874 | id: p.id, |
| 3875 | name: p.name, |
| 3876 | issueCount: q |
| 3877 | .from({ i: issues }) |
| 3878 | .where(({ i }) => eq(i.projectId, p.id)) |
| 3879 | .select(({ i }) => ({ total: count(i.id) })), |
| 3880 | })), |
| 3881 | ) |
| 3882 | } |
| 3883 | |
| 3884 | it(`each project gets its own aggregate result`, async () => { |
| 3885 | const collection = buildAggregateQuery() |
no test coverage detected