Open stefan-girlich opened 2 months ago
Do the queries work when just querying Postgrest? My understanding when implementing this, based on https://postgrest.org/en/v12/references/api/aggregate_functions.html, was that the syntax was column.max()
, and not column(max)
.
@bnjmnt4n You're right; column(max)
is not valid; my fix is therefore not ideal as it allows for invalid syntax.
Would you have any idea concerning how to fix the issues with the other aggregation functions besides count()
(#523 , #524 )?
Do you have a reproducible failing test case or example?
Sure; I mentioned them in #523 for visibility: https://github.com/supabase/postgrest-js/issues/523#issuecomment-2048080742
What kind of change does this PR introduce?
Fix dynamic TypeScript type for
data
when using aggregate functions other thancount
What is the current behavior?
Aggregate functions other than
count
will result in TypeScript errors for the resulting type ofdata
(#523)Bug fix for issues:
523
524 (potentially, not tested explicitly)
What is the new behavior?
Using the other aggregate functions "sum", "avg", "min", and "max" will not result in an erroneous TypeScript type for
data
.Additional context
I just generalized changes from #520 by @bnjmnt4n ; thanks for your work!