Add 'in' filter operator to card query language#4290
Merged
lukemelia merged 4 commits intoApr 1, 2026
Conversation
97400d0 to
161aaf3
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a new in filter operator to the card query language, enabling concise set-membership queries and supporting normalization/interpolation use cases for query-backed fields.
Changes:
- Introduces
InFilterto the runtime-common query types/validation and documents it in the internal dev reference. - Adds SQL generation support for
infilters in the index query engine, including empty-list and null-value behavior. - Expands query-field normalization + engine unit tests to cover
inbehavior and interpolation scenarios.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/software-factory/.agents/skills/boxel-development/references/dev-query-systems.md | Documents in as a filter type that requires on. |
| packages/runtime-common/query.ts | Adds InFilter type, guard, and query validation (assertInFilter). |
| packages/runtime-common/query-field-utils.ts | Treats in as an “empty predicate” key for abort-on-undefined interpolation behavior. |
| packages/runtime-common/index-query-engine.ts | Generates SQL conditions for in filters (inCondition, fieldInFilter). |
| packages/host/tests/unit/index-query-engine-test.ts | Adds unit tests for in filter semantics (multi, single, empty, null, nested, negation). |
| packages/host/tests/unit/query-field-normalization-test.ts | Adds tests for in filter interpolation from containsMany and abort behavior on undefined. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Contributor
Preview deployments |
161aaf3 to
73223ab
Compare
Contributor
Contributor
Adds a new `in` filter that checks if a field value is in a specified set, replacing the verbose `any` + `eq` workaround for set membership queries. Handles empty arrays (matches nothing), null values, and nested field paths. Supports interpolation from containsMany fields in query-backed fields. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
73223ab to
cef914f
Compare
Contributor
|
you are going to need both realm server and host tests. the host test will only test sqlite implementation, the realm server tests will test postgres implementation. i don't see realm server tests |
added 3 commits
March 31, 2026 22:20
Tests the 'in' filter via the _search HTTP endpoint against a postgres database, complementing the existing host tests that cover SQLite. Covers: multiple values, single value, empty array, null values, different fields, and negation with 'not'.
Covers filtering cards by id with the 'in' operator in both host (SQLite) and realm-server (Postgres) test suites.
habdelra
approved these changes
Apr 1, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
infilter operator to the card query language for concise set membership queriesany+eqworkaround:{ in: { id: ['id1', 'id2'] } }instead of{ any: [{ eq: { id: 'id1' } }, { eq: { id: 'id2' } }] }containsManyfields in query-backed fields (e.g.{ in: { tag: '$this.tags' } })Closes CS-10561
Changes
packages/runtime-common/query.ts—InFiltertype,isInFilter()guard,assertInFilter()validationpackages/runtime-common/index-query-engine.ts—inCondition()andfieldInFilter()SQL generationpackages/runtime-common/query-field-utils.ts— AddedintoEMPTY_PREDICATE_KEYSfor query abort on undefinedpackages/host/tests/unit/index-query-engine-test.ts— 6 query engine test casespackages/host/tests/unit/query-field-normalization-test.ts— 2 interpolation test casespackages/software-factory/.agents/skills/boxel-development/references/dev-query-systems.md— Addedinto documented filter typesTest plan
inwith multiple valuesaddress.city)not: { in: ... }containsManyfield resolves correctlycontainsManyfield aborts query gracefully🤖 Generated with Claude Code