Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow overriding default schema in from and rpc #318

Closed
osaxma opened this issue Sep 5, 2022 · 2 comments
Closed

Allow overriding default schema in from and rpc #318

osaxma opened this issue Sep 5, 2022 · 2 comments
Labels
enhancement New feature or request

Comments

@osaxma
Copy link

osaxma commented Sep 5, 2022

Feature request

This request was originally filed at supabase/supabase-flutter#206

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 the client 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 the client initially such as:

const client = PostgrestClient('url', {schema: 'public'});

// some where else in the app
const { data, error } = await supabase.from('table_name', 'schema_name' ).select()
// or
const { data, error } = await supabase.rpc('function_name', 'another_schema_name')

In both cases, if no schema is given, then the default schema from the client is used.

Describe alternatives you've considered

Creating multiple clients (one per schema) seems like the only option but it'd be much easier and cleaner to use the same client.

@soedirgo
Copy link
Member

soedirgo commented Sep 5, 2022

Does this look like what you want? #280

@osaxma
Copy link
Author

osaxma commented Sep 5, 2022

@soedirgo yeah I believe the same with different proposed solution(s) ... I'll close this and follow up there..

Thanks 🙏

@osaxma osaxma closed this as completed Sep 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants