Skip to content

feat(querying): row projections, keyset paging and capped counts (#65 onto main) - #66

Merged
AhmadRAbuhussein merged 3 commits into
mainfrom
muhannad/searchy-parameters
Oct 20, 2026
Merged

AhmadRAbuhussein merged 3 commits into
mainfrom
muhannad/searchy-parameters

Conversation

@mmalkhatib

Copy link
Copy Markdown
Contributor

#65 was stacked on #64 and merged into muhannad/searchy-parameters after #64 had already gone to main, so its two commits never reached main and 10.1.0 was published without them. This PR brings them over unchanged.

What it adds (same content as reviewed in #65):

  • RowProjection.Of<T> / Many<T,TChild>: project a chosen set of member paths into object[] rows in SQL, so a caller can return only the columns it asked for.
  • OrderByKeyset / AfterKeyset / ToPageAsync: keyset (cursor) paging over any sort, with a unique tiebreaker key.
  • CountUpToAsync: a count that stops at a limit and reports whether it was exceeded, so large lists don't pay for an exact count.
  • Public QueryExpressions (Parameter, Convert, TextMatch): the same parameterised value and text-match building blocks Searchy uses, for callers that build their own filters.

Tests: the PgSql integration suite (Testcontainers) and unit tests pass on the branch. Publishes 10.1.1.

mmalkhatib and others added 3 commits October 20, 2026 02:29
Three provider-neutral helpers for list endpoints that let the caller choose
what to read:

- RowProjection builds a Select to object[] rows from column expressions,
  with nested collection columns (ordered, capped). The query reads only
  the chosen columns, and its shape depends on which columns are chosen,
  never on values, so each choice compiles once.
- AfterKeyset/OrderByKeyset page by the last row's key values instead of
  Skip, so a deep page costs the same as the first. Positions are sent as
  parameters; nullable keys are refused, since SQL comparisons with NULL
  would drop rows.
- ToPageAsync reads one row beyond the page to say whether more follow,
  and CountUpToAsync stops counting at a limit, for lists that don't need
  an exact count of millions of rows.

Integration tests on PostgreSQL 17 cover column pruning, collection
columns, single compilation per shape and keyset completeness over
duplicate keys.
QueryExpressions.Parameter turns a value into an expression EF Core sends as
a parameter (the same capture Searchy uses), Convert exposes the invariant
conversion, and TextMatch exposes the package's text match, now with a
suffix variant as well as prefix and contains. For code that builds its own
filter expressions without going through SearchyRequest.
feat(querying): row projections, keyset paging and capped counts
@coderabbitai

coderabbitai Bot commented Oct 20, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration
  • Configuration used: Repository: simplify9/coderabbit/.coderabbit.yaml
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: c73d470c-ad73-4da3-9f55-80d423592e8f
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@AhmadRAbuhussein
AhmadRAbuhussein merged commit 2367494 into main Oct 20, 2026
6 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