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

support for multiple schema #81

Open
OscarVargas97 opened this issue Jan 23, 2025 · 2 comments
Open

support for multiple schema #81

OscarVargas97 opened this issue Jan 23, 2025 · 2 comments

Comments

@OscarVargas97
Copy link

Description:

Currently, the library does not support working with multiple schemas within a single database in Supabase. This limits the ability to manage more complex or segmented structures within a project.

Proposal:

Add support for multiple schemas in the configuration, allowing users to specify the target schema when interacting with tables. This could be achieved by:

A global configuration option for the default schema.
The ability to override the schema at the query level, providing greater flexibility.
Benefits:

Facilitate logical data separation within a single project.
Improve compatibility with databases already using multiple schemas.
Increase scalability and modularity for complex projects.
Expected Impact:

Current functions that assume a single default schema may need to be adjusted.
Additional documentation will be required to explain how to work with multiple schemas.
References:

Provide links or examples of similar projects that support multiple schemas to illustrate the use case.

@fzaninotto
Copy link
Member

ra-supabase relies on ra-data-postgrest, which allows to configure the schema (see https://github.com/raphiniert-com/ra-data-postgrest?tab=readme-ov-file#usage). Also, when working on another schema, you can just prepend it to the table name (e.g. getList('foo.bar')).

So in my view, this adapter already supports schemas.

Can you be more specific about what you're trying to do and what doesn't work?

@OscarVargas97
Copy link
Author

Hello, possibly it is a lack of knowledge on my part in this regard, thanks for the response. I'll check what you said

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants