Skip to content

Commit 7c48766

Browse files
committed
test(objectql): the stored-row read gate pin driver honours the caller's limit
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L9qibwurKjbb54r3yD6yJg
1 parent be87de7 commit 7c48766

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

‎packages/objectql/src/stored-metadata-type-read-gate.test.ts‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,10 @@ function makeDriver() {
6565
const driver: any = {
6666
name: 'memory', version: '0.0.0', supports: {},
6767
async connect() {}, async disconnect() {}, async checkHealth() { return true; }, async execute() { return null; },
68-
async find(o: string, ast: any) { return rows(o, ast); },
68+
async find(o: string, ast: any) {
69+
const matched = rows(o, ast);
70+
return typeof ast?.limit === 'number' ? matched.slice(0, ast.limit) : matched;
71+
},
6972
findStream() { throw new Error('ns'); },
7073
async findOne(o: string, ast: any) { return rows(o, ast)[0] ?? null; },
7174
async count(o: string, ast: any) { return rows(o, ast).length; },

0 commit comments

Comments
 (0)