Skip to content

feat: add In and NotIn membership operators - #1

Merged
amirhosseinmp02 merged 5 commits into
PepperX-Dev:mainfrom
AmirTahan80:feat/in-notin-operators
Oct 3, 2026
Merged

amirhosseinmp02 merged 5 commits into
PepperX-Dev:mainfrom
AmirTahan80:feat/in-notin-operators

Conversation

@AmirTahan80

Copy link
Copy Markdown
Contributor

Summary

Adds set membership filtering (In and NotIn) across the full QueryForge stack, allowing callers to match or exclude a collection of values in a single condition instead of chaining multiple OR or AND NOT clauses.

  • ConditionOperator.In (11): Matches when the column value equals any non-null candidate in the collection.
  • ConditionOperator.NotIn (12): Matches when the column value is excluded from all candidates in the collection.
  • Empty-list semantics: IN [] matches nothing (0 rows); NOT IN [] matches everything.

Changes

  • Core Engine (PepperX.QueryForge):

    • Added In and NotIn to ConditionOperator enum.
    • Extended ConditionSemantics.Unwrap to handle JsonValueKind.Array recursively.
    • Updated ConditionSemantics.IsExecutable for empty-list membership expressions.
    • Implemented null-safe three-valued logic evaluation in InMemoryQueryEngine.
  • Dapper Provider (PepperX.QueryForge.Dapper):

    • Implemented BuildMembershipIn with per-candidate parameterization (@p0, @p1, ...) and type coercion.
  • EF Core Provider (PepperX.QueryForge.EFCore):

    • Implemented LINQ Enumerable.Contains expression compilation with parameterized typed candidate lists.
  • Conformance Tests (PepperX.QueryForge.Conformance):

    • Added 9 comprehensive conformance tests covering all providers and edge cases.
  • Sample WebApi (PepperX.QueryForge.Sample.WebApi):

    • Added /api/users/filters/membership endpoint with runnable examples in Requests.http.

Verification

All 183 unit and integration tests passing (dotnet test).

امیرحسین طهان پور and others added 5 commits September 7, 2026 15:57
- Add ConditionOperator.In (11) and NotIn (12) to core enum
- Extend ConditionSemantics to unwrap JsonArray and handle empty-list semantics
- Add In/NotIn evaluation in InMemoryQueryEngine with null-safe logic
- Add BuildMembershipIn in Dapper SqlQueryCompiler with per-element parameterization
- Add Enumerable.Contains<T> expression building in EF Core ExpressionCompiler
- Add 9 conformance tests covering all providers and edge cases
- Add /api/users/filters/membership sample endpoint with HTTP request examples

Empty-list semantics: IN [] matches nothing, NOT IN [] matches everything
@amirhosseinmp02
amirhosseinmp02 merged commit 2f7f741 into PepperX-Dev:main Oct 3, 2026
3 checks passed
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.

2 participants