You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Adds TSDoc clarification to the select() method explaining that count with pagination methods returns the total number of matching rows, not the paginated count.
Problem
Users reported that count appears to "ignore" .range() filters, expecting count to match data.length when using pagination. However, this is the intended behavior, not a bug.
The confusion arises because:
data.length returns the number of rows in the current page (e.g., 10)
count returns the total number of matching rows across all pages (e.g., 100)
Solution
Added @remarks to the select() method TSDoc clarifying that when using count with .range() or .limit(), the returned count represents the total number of rows matching your filters (before pagination).
This is the intended behavior to enable building pagination UI like "Showing 1-10 of 100 results".
Clarified documentation for count operations when used with pagination or limit parameters, specifying that the count reflects the total number of rows matching filters rather than just the returned subset.
✏️ Tip: You can customize this high-level summary in your review settings.
A JSDoc remarks block was added to the select method in PostgrestQueryBuilder.ts to document that the count value returned when using range or limit reflects the total number of rows matching the applied filters, not just the current page subset.
Added JSDoc remarks block to select method documenting count behavior with range and limit operations
Estimated code review effort
🎯 1 (Trivial) | ⏱️ ~2 minutes
Poem
🐰 A count that counts the whole, not parts so small,
When range and limit dance, we've clarified it all!
The docs now sing of total rows that pass the test,
No more confusion—documentation's best! ✨
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
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
Adds TSDoc clarification to the
select()method explaining thatcountwith pagination methods returns the total number of matching rows, not the paginated count.Problem
Users reported that
countappears to "ignore".range()filters, expectingcountto matchdata.lengthwhen using pagination. However, this is the intended behavior, not a bug.The confusion arises because:
data.lengthreturns the number of rows in the current page (e.g., 10)countreturns the total number of matching rows across all pages (e.g., 100)Solution
Added
@remarksto theselect()method TSDoc clarifying that when usingcountwith.range()or.limit(), the returnedcountrepresents the total number of rows matching your filters (before pagination).This is the intended behavior to enable building pagination UI like "Showing 1-10 of 100 results".
Related
countbutdatacorrectly filtered byrange()andis()#1275Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.