@@ -1,4 +1,3 @@
|
||||
db-schemas = "required"
|
||||
db-anon-role = "required"
|
||||
|
||||
db-channel-enabled = "1"
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
db-schemas = "required"
|
||||
db-anon-role = "required"
|
||||
|
||||
db-channel-enabled = "true"
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
db-schemas = "required"
|
||||
db-anon-role = "required"
|
||||
# Not the default, but only works with PG* variables, which are not set
|
||||
db-config = false
|
||||
|
||||
@@ -8,7 +8,7 @@ db-pool-timeout = 10
|
||||
db-pre-request = ""
|
||||
db-prepared-statements = false
|
||||
db-root-spec = ""
|
||||
db-schemas = "required"
|
||||
db-schemas = "public"
|
||||
db-config = true
|
||||
db-tx-end = "commit"
|
||||
db-uri = "postgresql://"
|
||||
|
||||
@@ -8,7 +8,7 @@ db-pool-timeout = 10
|
||||
db-pre-request = ""
|
||||
db-prepared-statements = false
|
||||
db-root-spec = ""
|
||||
db-schemas = "required"
|
||||
db-schemas = "public"
|
||||
db-config = true
|
||||
db-tx-end = "commit"
|
||||
db-uri = "postgresql://"
|
||||
|
||||
@@ -8,7 +8,7 @@ db-pool-timeout = 10
|
||||
db-pre-request = ""
|
||||
db-prepared-statements = true
|
||||
db-root-spec = ""
|
||||
db-schemas = "required"
|
||||
db-schemas = "public"
|
||||
db-config = false
|
||||
db-tx-end = "commit"
|
||||
db-uri = "postgresql://"
|
||||
|
||||
@@ -8,7 +8,7 @@ db-pool-timeout = 10
|
||||
db-pre-request = ""
|
||||
db-prepared-statements = true
|
||||
db-root-spec = ""
|
||||
db-schemas = "required"
|
||||
db-schemas = "public"
|
||||
db-config = true
|
||||
db-tx-end = "commit"
|
||||
db-uri = "postgresql://"
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
# will be replaced in test
|
||||
db-schemas = "public"
|
||||
|
||||
app.settings.name_var = "John"
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
# tests how config options fall back with invalid types
|
||||
db-anon-role = "required"
|
||||
db-schemas = "required"
|
||||
|
||||
# expects string
|
||||
app.settings.test = false
|
||||
|
||||
@@ -27,11 +27,6 @@ cli:
|
||||
- name: missing db-anon-role
|
||||
expect: error
|
||||
env:
|
||||
PGRST_DB_SCHEMAS: required
|
||||
- name: missing db-schemas
|
||||
expect: error
|
||||
env:
|
||||
PGRST_DB_ANON_ROLE: required
|
||||
# failures: wrong config values
|
||||
- name: invalid server-unix-socket-mode not octal
|
||||
expect: error
|
||||
|
||||
+1
-4
@@ -92,7 +92,6 @@ def defaultenv():
|
||||
"PGDATABASE": os.environ["PGDATABASE"],
|
||||
"PGHOST": os.environ["PGHOST"],
|
||||
"PGUSER": os.environ["PGUSER"],
|
||||
"PGRST_DB_SCHEMAS": "public",
|
||||
"PGRST_DB_ANON_ROLE": os.environ["PGRST_DB_ANON_ROLE"],
|
||||
"PGRST_DB_CONFIG": "false",
|
||||
"PGRST_LOG_LEVEL": "info",
|
||||
@@ -641,9 +640,7 @@ def test_db_schema_reload(tmp_path, defaultenv):
|
||||
configfile = tmp_path / "test.config"
|
||||
configfile.write_text(config)
|
||||
|
||||
env = {key: value for key, value in defaultenv.items() if key != "PGRST_DB_SCHEMAS"}
|
||||
|
||||
with run(configfile, env=env) as postgrest:
|
||||
with run(configfile, env=defaultenv) as postgrest:
|
||||
response = postgrest.session.get("/rpc/get_guc_value?name=search_path")
|
||||
assert response.text == '"public, public"'
|
||||
|
||||
|
||||
Reference in New Issue
Block a user