Skip to content

Public schema vs private schema - Why both? #617

Answered by shorn
Vadorequest asked this question in Questions
Discussion options

You must be logged in to vote

TL:DR;
Data in the public schema is "open by default", data in other schemas is "restricted by default".


By default, tables in the public schema can be read/written by clients via the Supabase REST API. That means anybody can access table data in the public schema if they have your API key (usually referenced in the doco as the supabase key). The API key is usually shared via your client application, you must presume everyone in the world knows your API key because there's no practical way to keep it secret.

If you want to restrict read or write access to tables in the public schema - you need to enable row level security for each table and define policies declaring who is allowed to rea…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@Vadorequest
Comment options

Answer selected by Vadorequest
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants