Skip to content

Support setting Prefer: params=single-object when making .rpc() call #304

Open
@dshukertjr

Description

@dshukertjr

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions