diff --git a/src/PostgREST/Config/Database.hs b/src/PostgREST/Config/Database.hs index 8180975fe7..b6ae5887c1 100644 --- a/src/PostgREST/Config/Database.hs +++ b/src/PostgREST/Config/Database.hs @@ -50,6 +50,10 @@ dbSettingsNames = ,"db_pre_config" ,"db_extra_search_path" ,"db_max_rows" + ,"db_pool" + ,"db_pool_acquisition_timeout" + ,"db_pool_max_idletime" + ,"db_pool_max_lifetime" ,"db_plan_enabled" ,"db_pre_request" ,"db_prepared_statements" diff --git a/test/io/configs/expected/no-defaults-with-db-other-authenticator.config b/test/io/configs/expected/no-defaults-with-db-other-authenticator.config index b33a0a34ea..689adbe518 100644 --- a/test/io/configs/expected/no-defaults-with-db-other-authenticator.config +++ b/test/io/configs/expected/no-defaults-with-db-other-authenticator.config @@ -5,10 +5,10 @@ db-channel-enabled = false db-extra-search-path = "public,extensions,other" db-max-rows = 100 db-plan-enabled = true -db-pool = 1 -db-pool-acquisition-timeout = 30 -db-pool-max-lifetime = 3600 -db-pool-max-idletime = 60 +db-pool = 3 +db-pool-acquisition-timeout = 20 +db-pool-max-lifetime = 360 +db-pool-max-idletime = 20 db-pool-automatic-recovery = false db-pre-request = "test.other_custom_headers" db-prepared-statements = false diff --git a/test/io/configs/expected/no-defaults-with-db.config b/test/io/configs/expected/no-defaults-with-db.config index d1fd38c87a..ca2549aa57 100644 --- a/test/io/configs/expected/no-defaults-with-db.config +++ b/test/io/configs/expected/no-defaults-with-db.config @@ -5,10 +5,10 @@ db-channel-enabled = false db-extra-search-path = "public,extensions,private" db-max-rows = 1000 db-plan-enabled = true -db-pool = 1 -db-pool-acquisition-timeout = 30 -db-pool-max-lifetime = 3600 -db-pool-max-idletime = 60 +db-pool = 2 +db-pool-acquisition-timeout = 15 +db-pool-max-lifetime = 180 +db-pool-max-idletime = 10 db-pool-automatic-recovery = false db-pre-request = "test.custom_headers" db-prepared-statements = false diff --git a/test/io/db_config.sql b/test/io/db_config.sql index 65380590ef..c594ca38e2 100644 --- a/test/io/db_config.sql +++ b/test/io/db_config.sql @@ -18,6 +18,10 @@ ALTER ROLE db_config_authenticator SET pgrst.db_prepared_statements = 'false'; ALTER ROLE db_config_authenticator SET pgrst.db_pre_request = 'test.custom_headers'; ALTER ROLE db_config_authenticator SET pgrst.db_max_rows = '1000'; ALTER ROLE db_config_authenticator SET pgrst.db_extra_search_path = 'public, extensions'; +ALTER ROLE db_config_authenticator SET pgrst.db_pool = '2'; +ALTER ROLE db_config_authenticator SET pgrst.db_pool_acquisition_timeout = '15'; +ALTER ROLE db_config_authenticator SET pgrst.db_pool_max_lifetime = '180'; +ALTER ROLE db_config_authenticator SET pgrst.db_pool_max_idletime = '10'; ALTER ROLE db_config_authenticator SET pgrst.not_existing = 'should be ignored'; ALTER ROLE db_config_authenticator SET pgrst.server_cors_allowed_origins = 'http://example.com'; ALTER ROLE db_config_authenticator SET pgrst.server_trace_header = 'CF-Ray'; @@ -42,11 +46,7 @@ ALTER ROLE db_config_authenticator SET pgrst.log_level = 'ignored'; ALTER ROLE db_config_authenticator SET pgrst.db_uri = 'postgresql://ignored'; ALTER ROLE db_config_authenticator SET pgrst.db_channel_enabled = 'ignored'; ALTER ROLE db_config_authenticator SET pgrst.db_channel = 'ignored'; -ALTER ROLE db_config_authenticator SET pgrst.db_pool = 'ignored'; ALTER ROLE db_config_authenticator SET pgrst.db_pool_timeout = 'ignored'; -ALTER ROLE db_config_authenticator SET pgrst.db_pool_acquisition_timeout = 'ignored'; -ALTER ROLE db_config_authenticator SET pgrst.db_pool_max_lifetime = 'ignored'; -ALTER ROLE db_config_authenticator SET pgrst.db_pool_max_idletime = 'ignored'; ALTER ROLE db_config_authenticator SET pgrst.db_config = 'true'; -- other authenticator reloadable config options @@ -64,6 +64,10 @@ ALTER ROLE other_authenticator SET pgrst.db_prepared_statements = 'false'; ALTER ROLE other_authenticator SET pgrst.db_pre_request = 'test.other_custom_headers'; ALTER ROLE other_authenticator SET pgrst.db_max_rows = '100'; ALTER ROLE other_authenticator SET pgrst.db_extra_search_path = 'public, extensions, other'; +ALTER ROLE other_authenticator SET pgrst.db_pool = '3'; +ALTER ROLE other_authenticator SET pgrst.db_pool_acquisition_timeout = '20'; +ALTER ROLE other_authenticator SET pgrst.db_pool_max_lifetime = '360'; +ALTER ROLE other_authenticator SET pgrst.db_pool_max_idletime = '20'; ALTER ROLE other_authenticator SET pgrst.openapi_mode = 'disabled'; ALTER ROLE other_authenticator SET pgrst.openapi_security_active = 'false'; ALTER ROLE other_authenticator SET pgrst.server_cors_allowed_origins = 'http://example.com';