-
-
Notifications
You must be signed in to change notification settings - Fork 183
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
feat(postgrest, supabase): add useSchema()
method for making rest API calls on custom schema.
#525
Conversation
Is there a reason you are adding that as a parameter to from instead of a new method as it seems proposed in supabase/postgrest-js#280 ? Additionally, I think |
@Vinzent03 No, I had forgotten about that one. Thanks for bringing it up. |
schema
parameter to from()
to query custom schemasetSchema
method for making rest API calls.
|
@Vinzent03 Also would love to hear your thoughts on the method name. Some that went through my head were:
|
Ah okay. I would choose |
I like |
setSchema
method for making rest API calls.useSchema
method for making rest API calls.
useSchema
method for making rest API calls.useSchema
method for making rest API calls on custom schema.
Using the current workflow allows using one postgrest client with a specific schema for multiple calls. Adding it to |
Cool, in that case this PR should be ready for review. |
useSchema
method for making rest API calls on custom schema.useSchema()
method for making rest API calls on custom schema.
@dshukertjr Can you give an example of what the recommended permissions should be for a new schema for the Flutter client? For example, a table that would only be available to |
@garysm |
No, I've been developing locally, but I assume that can be configured in |
What kind of change does this PR introduce?
Allows developers to easily query custom schema.
Fixes #314
What is the current behavior?
There isn't a way to query other schemas once Supabase client is initialized. Some workarounds that I can think about right now would be
dispose
and re-initialize the client every time when querying custom schemaAll of them are kind of painful to implement.
What is the new behavior?
Developers can query custom schema like this:
Additional Context
Since
schema
name is already taken, we couldn't name the methodschema()
like how the js SDK does it.