Open
Description
Feature request
Is your feature request related to a problem? Please describe.
When calling a Postgres function via .rpc()
method, you can pass Prefer: params=single-object
header to be able to pass JSON object as the parameter. Was wondering if this is something we want to support.
https://postgrest.org/en/v9.0/api.html#calling-functions-with-a-single-json-parameter
Describe the solution you'd like
Add a flag or something to .rpc()
maybe? Something like this:
.rpc('my_function', {
name: 'Michael'
}, { singleObject: true })
Describe alternatives you've considered
A developer can create a regular Postgres function with named parameters.
Additional context
This feature was requested on the Dart library, and wanted to bring the discussion over to the JS library.
supabase/supabase-flutter#197