Add bounded live query cursor continuation

This commit is contained in:
Timothy J. Aveni
2026-09-22 17:20:00 -07:00
parent b8571d054b
commit ca83dbd1a7
4 changed files with 51 additions and 8 deletions
+8
View File
@@ -112,6 +112,14 @@ test("typed reference operands and scalar membership tests reject unbounded lite
test("new runtime operator matrix accepts direct count and rejects unsupported relational plans", async () => {
const { unsupportedQueryOperator } = await import("../src/execution-world/query-operators.js");
assert.equal(unsupportedQueryOperator(await compile("aggregate { count }")), undefined);
assert.equal(
unsupportedQueryOperator(
await compileAggregationDocument(
`query Report($after: Cursor) {root {tasks(first: 30, after: $after, orderBy: [{cost: ASC}]) {entries {cursor node {cost}} pageInfo {hasNextPage endCursor}}}}`,
),
),
undefined,
);
for (const expression of [
"aggregate { sum { estimatedHours } }",
"filter(where: {estimatedHours: {gt: 0}}) { aggregate { count } }",
+20
View File
@@ -0,0 +1,20 @@
import assert from "node:assert/strict";
import { test } from "node:test";
import { loadReaderWorkspace } from "./reader-fixture.js";
import { compileExecutionPlan } from "../src/execution-world/index.js";
test("local relationship pages may reuse exactly the confirmed source window", async () => {
const workspace = await loadReaderWorkspace((name, text) => {
if (name === "queries/replica-inputs.graphql")
return text.replace("highlights(all: 1000)", "highlights(first: 10)");
if (name === "queries/reader-screen.graphql")
return text
.replace("ReaderScreen($color: String!)", "ReaderScreen")
.replace(
"highlights(all: 1000, where: {color: {eq: $color}}, orderBy: [{range: {start: ASC}}])",
"highlights(first: 10)",
)
.replace("_camino { relations { highlights { aggregate { count } } } }", "");
return text;
});
assert.doesNotThrow(() => compileExecutionPlan(workspace));
});