Pass custom settings to the DB's SESSION (#1063)
- allows queries to refer to current_setting('app.settings.foo') to retrieve variables
- useful for 12-factor apps (app data can be in environment)
- provides workaround for AWS Relational Database Service (RDS) not
allowing `ALTER DATABASE SET 'app.[KEY]' TO '[VALUE]'` on database.
This commit is contained in:
committed by
Joe Nelson
parent
70ce1b9329
commit
a46b6f5020
@@ -73,6 +73,9 @@ _baseCfg = -- Connection Settings
|
||||
10 Nothing (Just "test.switch_role")
|
||||
-- Debug Settings
|
||||
True
|
||||
[ ("app.settings.app_host", "localhost")
|
||||
, ("app.settings.external_api_secret", "0123456789abcdef")
|
||||
]
|
||||
|
||||
testCfg :: Text -> AppConfig
|
||||
testCfg testDbConn = _baseCfg { configDatabase = testDbConn }
|
||||
|
||||
Reference in New Issue
Block a user