IS there a way to change where the Postgre REST AP...
# help
f
IS there a way to change where the Postgre REST API is pointing for databases? I'm testing supabase on a docker container, and I've created a db with a different name other than
public
. I'd like to point to that database, but I don't know how to do that using REST APIs. Looks like they point by default to the
public
db
From PostgREST documentation looks like it is something that needs to be configured with a .conf file, isn't there any other way?
PostgREST Database Connection (Docker)
s
@User Hm, what configuration are you trying to change? The [db-uri](https://postgrest.org/en/stable/configuration.html#db-uri) or the [db-schema](https://postgrest.org/en/stable/configuration.html#db-schema)?
f
Looks like the db-schema, since I'm not using the postgres protocol to connect, but rest APIs
For example
https://localhost:6789/rest/v1/table?
connects by default to
public
database, which is the one I'd like to change
(and by the way, in docker the public database is not created automatically. I think it can be added in the docker file to be created by default, so users don't have to create it manually)
Thank you for answering anyway @User
s
I see, then you refer to not use the
public
schema(not the db) and change it to another one.
I think it should be possible to change it on the docker container, with the PGRST_DB_SCHEMA env var.
On the hosted version, this is not yet possible, but it's planned to expose this config option.
f
I've set
env PGRST_DB_SCHEMA=new_schema
in the supabase_db container and restarted it, but doesn't seem to change anything
Uh sorry, it is the
export
command on linux actually. Let me retry
still connecting to public
Mhh, if I restart the container I'll lose the env variable. Is there a way to overcome this?
s
Hm, that's strange. Perhaps you can try with the official postgrest docker image and then try with the supabase/cli image? https://hub.docker.com/r/postgrest/postgrest
f
Will try that tomorrow, thank you