-
Notifications
You must be signed in to change notification settings - Fork 164
how to use db-schema? #160
Comments
The env var is |
Hi @steve-chavez, thanks, PGRST_DB_SCHEMA is working fine (!). The term "schema" is confuse, the suggestion is to change documentation, can I edit there? Now I have two new problmes:
The root also shows correct function definition, {
"/rpc/add_them":{
"post":{
"tags":["(rpc) add_them"],
"produces":["application/json","application/vnd.pgrst.object+json"],
"parameters":[{
"required":true,"schema":{"required":["a","b"],
"type":"object",
"properties":{"a":{"format":"integer","type":"integer"},"b":{"format":"integer","type":"integer"}}},
"in":"body","name":"args"
},{"$ref":"#/parameters/preferParams"}],"responses":{"200":{"description":"OK"}
}}}
} |
I think the term schema is pretty standard in a database context, but sure if you have suggestions for improving the docs you can open a PR and we'll discuss it there. About your problems:
version: '3'
services:
pgrst1:
image: postgrest/postgrest
ports:
- "3000:3000"
environment:
PGRST_DB_URI: postgres://postgrest_test_authenticator@localhost/postgrest_test
PGRST_DB_SCHEMA: test
PGRST_DB_ANON_ROLE: postgrest_test_anonymous
network_mode: host
pgrst2:
image: postgrest/postgrest
ports:
- "3001:3001"
environment:
PGRST_DB_URI: postgres://postgrest_test_authenticator@localhost/sample
PGRST_DB_SCHEMA: api
PGRST_DB_ANON_ROLE: postgrest_test_anonymous
PGRST_SERVER_PORT: 3001
network_mode: host
|
Thanks @steve-chavez, 1 and 2 are solutions and are working fine with my server (!). We can close this issue. |
I am running
docker run --rm --net=host -p 3000:3000 -e DB_SCHEMA=test -e PGRST_DB_URI="postgres://postgres:etc@localhost:5432/etcdb" -e PGRST_DB_ANON_ROLE="postgres" postgrest/postgrest &
And to test I also used at SQL a public
create table t
, but all other data is at SQL'sCREATE schema test
. Eg. there wascreate table test.t
... So,http://localhost:3000/t
is fine (!), BUT:http://localhost:3000/test.t
is an error, "relation "public.test.t" does not exist".so, how to use DB_SCHEMA env, or how to say that I need a SQL-schema name that is not
public
?The text was updated successfully, but these errors were encountered: