Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion test/Spec.hs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{-# LANGUAGE DeriveAnyClass #-}
{-# LANGUAGE DerivingStrategies #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE CPP #-}

module Main (main) where

Expand All @@ -25,7 +26,12 @@ main :: IO ()
main = do
hSetEncoding stdout utf8
hSetEncoding stderr utf8
dbPool <- Pool.createPool (Sql.connectPostgreSQL connectionSettings) Sql.close 10 5 10
dbPool <-
#if MIN_VERSION_resource_pool(0,4,0)
Pool.newPool (Pool.defaultPoolConfig ((Sql.connectPostgreSQL connectionSettings)) Sql.close 1 10)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you sure? Wasn't newPool added in v0.3.0.0?

Copy link
Contributor Author

@jhrcek jhrcek Jun 29, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was, but at that point there was no defaultPoolConfig, which was introduces in 0.4.0.0 :)

So I'm doing minimum amount of changes to make it work warning-free with the versions we allow in cabal file.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah I see. 👍

#else
Pool.createPool (Sql.connectPostgreSQL connectionSettings) Sql.close 10 5 10
#endif
hspec $ unitTests dbPool

unitTests :: Pool.Pool Sql.Connection -> Spec
Expand Down