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
In No Way can I access my custom schema #490
Comments
ran into same issue which really reduces useful of this library when trying to use vecs schema. Would be great to support different schema at earliest |
You can change the schema that's queried by passing it as part of the from supabase import create_client
from supabase.lib.client_options import ClientOptions
opts = ClientOptions().replace(schema="new_schema")
client = create_client(url, key, options=opts)
# now all queries will be run in the `new_schema` schema Edit: I'd not noticed the part about multiple schemas - you could create one client per schema; but adding something to switch schemas after client initialization would be nice to have as well I think, let me look into it. Reopening the issue for now. |
That's nice but isn't there an option where i see that we can do supabase.schema("private").table("some_table")... i can see Schema suggestion on VS Code (may i know where it might be used) |
The vscode suggestion is probably coming from here ; it's probably just picking up the attribute named Also I had forgotten earlier: We can switch the schema later, but that method is on the postgrest client from supabase import create_client
from supabase.lib.client_options import ClientOptions
opts = ClientOptions().replace(schema="new_schema")
client = create_client(url, key, options=opts)
# now all queries will be run in the `new_schema` schema
client.postgrest.schema("newest_schema")
# now all queries will be run in the `newest_schema` schema |
Describe the bug
I can see suggestions for supabase.schema("new_schema").table....
To Reproduce
See above
Expected behavior
Expected to call <schema_name>.<table_name>
Errors
File "xxx", line 18, in
supabase.schema()
TypeError: 'str' object is not callable
Other Info
Even if I change table name to supabase.table(f"<schema_name>.<table_name>") it only gives public.<schema_name>.<table_name>
Cant call ClientOptions() anymore (I think its no longer supported) as i have multiple tables and multiple schemas and cant fix to 1 schema.
Additional context
Please look into the issue, or suggest an alternative way. I know functions are a way but using python seems more easier than writing SQL functions.
The text was updated successfully, but these errors were encountered: