|
Hi, I'm trying to build a private table (the table should not be accessible through supabase UI). create schema private;
grant usage on schema private to anon, authenticated;
create table private.todos_private
...I also added the My problem: Why is the app trying to access the public schema, and how can I access the custom (P.S. I'm using the supabase |
Replies: 4 comments 13 replies
|
I don't have an answer, but I am getting close 😅 In TypeScript, const supabase = createClient('supabaseUrl', 'annonKey', { schema: 'private' })
const { data, error } = await supabase.from('posts').select()I thought this was the answer, but when I ran this, I got an error saying |
|
Hi, everyone this is not supported yet. we need to expose the Created an issue internally to track this Edit - you can expose schemas in the API by editing the "Exposed schemas" option here |
|
Overall, I don't understand why a private schema would be exposed. I have a private schema myself, but I only use it to create functions that are called by other public functions. My reason for having a private schema is to keep it hidden from the public. Exposing it defeats the purpose of having a private schema in the first place. |
|
I'm not sure if it's the answer you're looking for, but you can go to supabase dashboard settings - API - Exposed schemas and select the custom schema you have made and after that you will be able to fetch data from there! |
Hi, everyone this is not supported yet. we need to expose the
db-schemaparameter in the dashboard to allow configuring the schemas postgrest should connect to https://postgrest.org/en/v7.0.0/configuration.htmlCreated an issue internally to track this
Edit - you can expose schemas in the API by editing the "Exposed schemas" option here