Skip to content

Support filtering data records by arbitrary filters (#873) - #874

Open
KallynGowdy wants to merge 2 commits into
developfrom
claude/casualos-issue-873-p34kwi
Open

KallynGowdy wants to merge 2 commits into
developfrom
claude/casualos-issue-873-p34kwi

Conversation

@KallynGowdy

Copy link
Copy Markdown
Member

Adds a MongoDB-style filter option to listData when listing by
marker, so callers can narrow results by JSON content in addition to
marker/address pagination. Filters support $eq/$gt/$gte/$lt/$lte/$in/
$startsWith/$endsWith/$contains/$isNull with $and/$or/$not combinators,
and are bounded by depth/size limits.

Implemented via a new DataRecordsFilters module (parser + JS evaluator

  • Prisma JSON where-clause builder), wired through RecordsServer,
    DataRecordsController, DataRecordsStore, and all four store
    implementations (Memory, Prisma, Sqlite, Mongo). Sqlite applies the
    filter in JS on top of its existing raw marker query since Prisma
    can't push JSON filters into SQLite; Mongo rejects filters as
    not_supported since it's out of the issue's listed scope.

Adds a MongoDB-style `filter` option to `listData` when listing by
marker, so callers can narrow results by JSON content in addition to
marker/address pagination. Filters support $eq/$gt/$gte/$lt/$lte/$in/
$startsWith/$endsWith/$contains/$isNull with $and/$or/$not combinators,
and are bounded by depth/size limits.

Implemented via a new DataRecordsFilters module (parser + JS evaluator
+ Prisma JSON where-clause builder), wired through RecordsServer,
DataRecordsController, DataRecordsStore, and all four store
implementations (Memory, Prisma, Sqlite, Mongo). Sqlite applies the
filter in JS on top of its existing raw marker query since Prisma
can't push JSON filters into SQLite; Mongo rejects filters as
not_supported since it's out of the issue's listed scope.
@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

TigerBeetle startup (~8-10s to open its journal file) was right at
the edge of Jest's default 10s beforeAll timeout, causing the entire
RecordsServer.spec.ts suite (which shares one top-level beforeAll) to
fail en masse under any CPU contention. Give that hook a 60s timeout.

Also updates the procedures-listing snapshot to include the new
`filter` input added to `listData` for #873.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants