inference with Supabase
Hi, I'm trying to setup a basic crud with Supabase as data provider and antd for generating the UI's with the inferencer.
Now the schema I have in postgresql, is not the public one. But with another name. I passed this name when configuring the Supabase client. But when I try to browse to the page in chrome it throws an error.
In the console logs there is mentioned that the schema should be the public schema.
Is there no way to configure the schema does it really have to be the public one?
5 Replies
Hi @Busulle. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
----------------------
It is possible to configure the schema in Supabase to use a custom schema instead of the default
public
schema. However, there are some steps and considerations to ensure it works correctly with refine.
Steps to Configure Custom Schema in Supabase with refine
1. Configure Supabase Client with Custom Schema:
You need to set up your supabaseClient
with the custom schema. Here is an example of how to do it:
2. Pass Schema in Meta Object:
When using data hooks like useTable
, you can pass the schema
property in the meta
object to override the default schema. Here is an example:
3. Swizzle the Data Provider (if needed):
If you encounter issues, you might need to swizzle the data provider to customize it further. This involves copying the implementation of the @refinedev/supabase
's dataProvider
and liveProvider
into your project and modifying it to handle multiple schemas. Here is an example modification for the create
method:
Additional Resources
- Using meta
to pass values to data provider (https://refine.dev/docs/data/packages/supabase/#schema---using-custom-schema)
- Discussion on fetching data from multiple schemas (https://github.com/refinedev/refine/discussions/5094)
By following these steps, you should be able to configure and use a custom schema with Supabase in your refine project. If you continue to face issues, it might be helpful to check the specific error messages and ensure that all configurations are correctly set.
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------<@281353575504805888> kapa.ai is still learning and improving, please let us know how it did by reacting below
rival-blackOP•7mo ago
@kapa.ai and what in combination with the antdinference?
Let me check the knowledge base for you. One moment! :books:
----------------------
To use a custom schema with Supabase in combination with
@refinedev/inferencer
and Ant Design, you need to ensure that the custom schema is correctly passed to the data provider and that the inferencer components are set up to use this configuration.
Here’s how you can achieve this:
Step-by-Step Guide
1. Configure Supabase Client with Custom Schema:
Set up your Supabase client to use the custom schema as shown below:
2. Pass Schema in Meta Object:
When using inferencer components, you can pass the schema
property in the meta
object to override the default schema. Here is an example of how to do this:
3. Swizzle the Data Provider (if needed):
If you encounter issues, you might need to swizzle the data provider to customize it further. This involves copying the implementation of the @refinedev/supabase
's dataProvider
and liveProvider
into your project and modifying it to handle multiple schemas. Here is an example modification for the `
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------<@281353575504805888> kapa.ai is still learning and improving, please let us know how it did by reacting below