You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Oct 9, 2025. It is now read-only.
Right now you can only set a schema in initial supabase client setup.
It would be very useful to be able to override the default ('public' normally) schema on individual calls.
Describe the solution you'd like
Add a postgrest-js operation .schema('myschema') that can be used with other operations on a single call basis.
Describe alternatives you've considered
Currently the below works in my environment. It does not impact storage and auth, but have not tested on realtime yet.
let schema = ''
var supabase = supabase.createClient(SUPABASE_URL, SUPABASE_KEY, {
fetch: (requestInfo, requestInit) => {
if (schema) requestInit.headers['Accept-Profile'] = schema
return(fetch(requestInfo,requestInit))
}
export function setSchema(schemaName) {
schema = schemaName
}
And call that before and after supabase database call to another schema.
Additional context
It appears the only thing required to make PostgREST work with an API available schema is setting the Accept-Profile' header. This should be easily done in postgrest-js with a .schema('myschema') function added to postgrest calls.