feat: Make db-uri optional

The default is now "postgresql://" which falls back to LIBPQ environment variables.

Resolves #1991, Ref #1823
This commit is contained in:
Wolfgang Walther
2022-01-22 15:13:19 +01:00
parent ec09b87940
commit 9ed30c0ba4
21 changed files with 108 additions and 107 deletions
+2 -6
View File
@@ -11,8 +11,7 @@ import qualified Hasql.Transaction as HT
import qualified Hasql.Transaction.Sessions as HT
import Text.Heredoc
import Protolude hiding (get, toS)
import Protolude.Conv (toS)
import Protolude hiding (get, toS)
import PostgREST.Query.QueryBuilder (requestToCallProcQuery)
import PostgREST.Request.Types
@@ -20,14 +19,11 @@ import PostgREST.Request.Types
import PostgREST.DbStructure.Identifiers
import PostgREST.DbStructure.Proc
import SpecHelper (getEnvVarWithDefault)
import Test.Hspec
main :: IO ()
main = do
testDbConn <- getEnvVarWithDefault "PGRST_DB_URI" "postgres://postgrest_test@localhost/postgrest_test"
pool <- P.acquire (3, 10, toS testDbConn)
pool <- P.acquire (3, 10, "postgresql://")
hspec $ describe "QueryCost" $
context "call proc query" $ do