From b0c2f513e0cb9d66fa23bda9d3a4948b2f10bf41 Mon Sep 17 00:00:00 2001 From: Tom Ellis Date: Sat, 5 Sep 2020 18:31:43 +0100 Subject: [PATCH] Suggest using optionsToDefaultConfig to generate Config from Options rather than changing the connectionOptions field of Config. Partially addresses https://github.com/jfischoff/tmp-postgres/issues/267 --- src/Database/Postgres/Temp/Internal.hs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/Database/Postgres/Temp/Internal.hs b/src/Database/Postgres/Temp/Internal.hs index 19b84e9..511d29e 100644 --- a/src/Database/Postgres/Temp/Internal.hs +++ b/src/Database/Postgres/Temp/Internal.hs @@ -432,8 +432,14 @@ withRestart db f = bracket (restart db) (either mempty stop) $ either (pure . Left) (fmap Right . f) -- | Attempt to create a 'Config' from a 'Client.Options'. Useful if you --- want to create a database owned by a specific user you will also login --- with among other use cases. +-- want to create a database +-- +-- * owned by a specific user you will also login with +-- * with a specific name (i.e. not the default name, "postgres") +-- +-- among other use cases. Changing the 'connectionOptions' field of +-- 'Config' does /not/ achieve these results and you are likely to see +-- unexpected behaviour if you try to. -- -- @since 1.21.0.0 optionsToDefaultConfig :: Client.Options -> Config