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
I'm not familiar with Postgrest outside of Supabase, but looking at the docs I can't see a valid way to serialize the body into the URL (and that might have URL length issues anyway), but it seems like we could send a POST request with return=minimal in the prefer header to achieve a similar result as an alternative. I'm not clear on whether there's any internal difference in what Postgrest actually executes internally in HEAD vs return=minimal.
Changing the logic in PostgrestClient adds it to the URL search params to send a POST + return=minimal for head requests looks straightforward but may have implications I don't understand - and elsewhere in the client the return=representation looks to be hard coded anyway, overwriting custom headers set there.
Workarounds include
just get the full payload as well as the count (head: false)
add a separate RPC which invokes the original RPC and just returns the count instead, and invoke that
refactor the RPC to take scalar args instead of a custom type
To Reproduce
See issue description.
Expected behavior
Supabase client should at least clearly indicate that this invocation cannot be done by identifying object types in the args when adding them to the url search params; ideally it should just work, however, e.g. using the return=minimal header to support this scenario.
Screenshots
N/A
System information
Not relevant.
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered:
Bug report
Describe the bug
I have a function which accepts an object custom type as an argument. I can invoke it with e.g.
but if I try to get a count without a body, e.g.
then it fails, because
head
causes aHEAD
request to be sent, antHEAD
requests can't have bodies, soI'm not familiar with Postgrest outside of Supabase, but looking at the docs I can't see a valid way to serialize the body into the URL (and that might have URL length issues anyway), but it seems like we could send a
POST
request withreturn=minimal
in theprefer
header to achieve a similar result as an alternative. I'm not clear on whether there's any internal difference in what Postgrest actually executes internally in HEAD vsreturn=minimal
.Changing the logic in PostgrestClient adds it to the URL search params to send a POST +
return=minimal
forhead
requests looks straightforward but may have implications I don't understand - and elsewhere in the client thereturn=representation
looks to be hard coded anyway, overwriting custom headers set there.Workarounds include
head: false
)To Reproduce
See issue description.
Expected behavior
Supabase client should at least clearly indicate that this invocation cannot be done by identifying object types in the args when adding them to the url search params; ideally it should just work, however, e.g. using the
return=minimal
header to support this scenario.Screenshots
N/A
System information
Not relevant.
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: