Repository navigation
feat(querying): row projections, keyset paging and capped counts - #65
Merged
AhmadRAbuhussein merged 2 commits intoOct 20, 2026
Merged
Conversation
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.
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. 🗂️ Base branches to auto review: 8
Please check the settings in the CodeRabbit UI or the ⚙️ Run configuration
You can disable this status message by setting the Use the checkbox below for a quick retry:
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. Comment |
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.
AhmadRAbuhussein
approved these changes
Oct 20, 2026
AhmadRAbuhussein
merged commit Oct 20, 2026
c0a247b
into
muhannad/searchy-parameters
3 checks passed
AhmadRAbuhussein
added a commit
that referenced
this pull request
Oct 20, 2026
feat(querying): row projections, keyset paging and capped counts (#65 onto main)
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.
Stacked on #64; review that first.
Three small provider-neutral helpers over
IQueryable<T>, for list endpoints where the caller chooses what to read. They take already-resolved expressions and know nothing about requests, JSON or permissions.RowProjection.Of<T>(columns)/RowProjection.Many<T,TChild>(...): aSelecttoobject[]rows, including nested collection columns (ordered, capped). PostgreSQL reads only the chosen columns, including inside a collection. The shape depends on which columns are chosen, not on values, so each choice compiles once.AfterKeyset/OrderByKeyset: keyset paging.(k1 > v1) OR (k1 = v1 AND k2 > v2) …, with<for descending keys. Positions are parameters; strings compare throughstring.Compareand enums through their underlying type. Nullable keys are refused, since NULL comparisons would drop rows. End the keys with a unique column.ToPageAsync(size): a page plushasMorefrom one query that reads one extra row.CountUpToAsync(limit):count(*)overLIMIT limit+1, for '10,000+'.Tests (PostgreSQL 17, Testcontainers), 10 new, 27/27 in the project:
hasMoreand capped counts are right at the boundaries.Unit tests still pass, 24/24.