Skip to content

Commit faa4ac2

Browse files
committed
test(objectql): the sibling-restrict pins' driver double applies the caller's limit
Claude-Session: https://claude.ai/code/session_01EUBvqtauTDmHi2ZgY759p2 Co-authored-by: Claude <noreply@anthropic.com>
1 parent 969c407 commit faa4ac2

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

‎packages/objectql/src/engine-cascade-delete-sibling-restrict.test.ts‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,9 @@ function makeDriver() {
7777
rowsOf: (o: string): Row[] => Array.from(storeFor(o).values()),
7878
async connect() {}, async disconnect() {}, async checkHealth() { return true; }, async execute() { return null; },
7979
async syncSchema() {},
80-
async find(o: string, ast: { where?: unknown } | undefined) {
81-
return Array.from(storeFor(o).values()).filter((r) => matches(r, ast?.where));
80+
async find(o: string, ast: { where?: unknown; limit?: unknown } | undefined) {
81+
const rows = Array.from(storeFor(o).values()).filter((r) => matches(r, ast?.where));
82+
return typeof ast?.limit === 'number' ? rows.slice(0, ast.limit) : rows;
8283
},
8384
async findOne(o: string, ast: { where?: unknown } | undefined) {
8485
for (const r of storeFor(o).values()) if (matches(r, ast?.where)) return r;

0 commit comments

Comments
 (0)