In the docs, it states that "Realtime only works f...
# off-topic
g
In the docs, it states that "Realtime only works for tables in the public schema". Are there any plans for Realtime to work for schemas other than "public"? I'd like to separate my data for different features of my app into different schemas. If non-public schemas don't work for Realtime, does it make sense for the web app UI to expose non-public schemas under /database/replication? https://supabase.com/docs/guides/api#realtime-api-1
This feature would help in many ways.
g
I don't have time to dig into this right now... but that note seems strange as realtime has schema options also in its API. You might also need to launch a supabase client specifically with that schema as default is public. I'll check later, but it might be worth trying it.
g
Yeah, that was confusing me too. e.g.
Copy code
var allPublicInsertChanges = socket
  .channel('realtime:public')
Why specify schema if it's locked to public.
Found out APIs aren't even generated for anything outside the public schema, so my guess is that includes Realtime. If anyone knows when APIs on schemas other than the public schema are coming, that would be great to know.
g
g
Godsend. Thanks, this gives me something to try now. I totally missed the "extra search path" section.
g
It does work, just tested it. Bit of a pain. You have to set up supabase init client with schema option. If you are using supabase.js the subscription uses that schema, you can't use schema.table in the subscribe. Then you need that schema set in API field (not the search path one). Then you need that schema set up with grants for auth/authorized users and possibly table with proper grants....
g
Much appreciated. I missed the ability to add to the "Schema" field where the public and storage schemas are protected. The UI needs a little work there. I'll open an issue for it if it doesn't already exist.