Expose Schema via SQL Query

Hey guys, I was wondering if Supabase allows us to expose a newly created schema via SQL query to the Data API. We’d need this for our automated onboarding process.
3 Replies
Fieryduck82579
Fieryduck825792mo ago
Using Custom Schemas | Supabase Docs
You need additional steps to use custom database schemas with data APIs.
inder
inder2mo ago
I assume you mean expose the schema for the API calls. In addition to setting up permissions (link provided by fieryduck), expose the schema using management api https://supabase.com/docs/reference/api/v1-update-postgrest-service-config You'll have to provide the schema names which are already exposed as well. For example
curl -X PATCH \
-d '{"db_schema": "public,graphql_public,custom-schema"}' \
-H 'Authorization: Bearer <ACCESS_TOKEN>' \
-H 'Content-Type: application/json' \
https://api.supabase.com/v1/projects/<PROJECT_REF>/postgrest
curl -X PATCH \
-d '{"db_schema": "public,graphql_public,custom-schema"}' \
-H 'Authorization: Bearer <ACCESS_TOKEN>' \
-H 'Content-Type: application/json' \
https://api.supabase.com/v1/projects/<PROJECT_REF>/postgrest
PlaxXOnline
PlaxXOnlineOP2mo ago
Thats exactly what i meant, thank you!

Did you find this page helpful?