Skip to content

Allow overriding default schema in from and rpc #206

Closed
@osaxma

Description

@osaxma

Is your feature request related to a problem? Please describe.

Currently it's only possible to use a single schema -- i.e. the one passed to SupabaseClient upon instantiation.

Describe the solution you'd like

In some cases, I would like to run a query or invoke an rpc on a different schema than the one given to SupabaseClient such as:

final client = SupabaseClient('url', 'api_key', schema: 'public');

// some where else in the app
final res = await client.from('table_name', schema: 'api').select().eq('para', para).execute(); 
// or
final res = await client.rpc('some_function', schema: 'api_functions').select().execute();

In the above example, schema should be nullable and if it was not passed then the SupabaseClient.schema is used.

Describe alternatives you've considered

Creating another SupabaseClient seems like the only option but it'd be much easier and cleaner to use the same client.

Tasks

If you agree with the proposed changes, please let me know and I can carry the following tasks:

  • update rpc method on postgrest-dart package
  • update from method, rpc method, and postgrest-dart version on supabase-dart package
  • update supabase-dart version on supabase-flutter package

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestpostgrestThis issue or pull request is related to postgrest

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions