Skip to content

Commit 1920301

Browse files
authored
Fix deprecation warning (#43)
1 parent c4b7662 commit 1920301

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

test/Spec.hs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{-# LANGUAGE DeriveAnyClass #-}
22
{-# LANGUAGE DerivingStrategies #-}
33
{-# LANGUAGE FlexibleContexts #-}
4+
{-# LANGUAGE CPP #-}
45

56
module Main (main) where
67

@@ -25,7 +26,12 @@ main :: IO ()
2526
main = do
2627
hSetEncoding stdout utf8
2728
hSetEncoding stderr utf8
28-
dbPool <- Pool.createPool (Sql.connectPostgreSQL connectionSettings) Sql.close 10 5 10
29+
dbPool <-
30+
#if MIN_VERSION_resource_pool(0,4,0)
31+
Pool.newPool (Pool.defaultPoolConfig ((Sql.connectPostgreSQL connectionSettings)) Sql.close 1 10)
32+
#else
33+
Pool.createPool (Sql.connectPostgreSQL connectionSettings) Sql.close 10 5 10
34+
#endif
2935
hspec $ unitTests dbPool
3036

3137
unitTests :: Pool.Pool Sql.Connection -> Spec

0 commit comments

Comments
 (0)