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
The count field on the response always represents the whole table despite filtering etc. This is because it's retrieved from Prefer: count={exact|estimated|planned}. It should instead come from Content-Range without the prefer count parameter.
To Reproduce
Run a .from().select().limit(1)
Check the count (it's not 0 or 1).
Expected behavior
It should be 0 or 1.
Additional context
For now we should just let count represent the right value—for supabase-js v2 we should use the Prefer: count parameter in a dedicated count call and maybe rpc().
The text was updated successfully, but these errors were encountered:
I think a typical use case of count is for pagination, so it would make sense to respect filters like match or eq, but I wonder if count should respect modifiers like limit or range.
When I tested it, count did respect filters, but ignored modifiers, which feels like the desired behavior!
Bug report
Describe the bug
The
count
field on the response always represents the whole table despite filtering etc. This is because it's retrieved fromPrefer: count={exact|estimated|planned}
. It should instead come fromContent-Range
without the prefercount
parameter.To Reproduce
.from().select().limit(1)
count
(it's not 0 or 1).Expected behavior
It should be 0 or 1.
Additional context
For now we should just let
count
represent the right value—for supabase-js v2 we should use thePrefer: count
parameter in a dedicatedcount
call and mayberpc()
.The text was updated successfully, but these errors were encountered: