hasql-pool 0.5.1 → 0.5.2
raw patch · 3 files changed
+5/−5 lines, 3 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
Files
- hasql-pool.cabal +1/−1
- library/Hasql/Pool/ResourcePool.hs +1/−1
- test/Main.hs +3/−3
hasql-pool.cabal view
@@ -1,7 +1,7 @@ name: hasql-pool version:- 0.5.1+ 0.5.2 category: Hasql, Database, PostgreSQL synopsis:
library/Hasql/Pool/ResourcePool.hs view
@@ -11,7 +11,7 @@ withResourceOnEither :: Pool resource -> (resource -> IO (Either failure success)) -> IO (Either failure success) withResourceOnEither pool act = mask_ $ do (resource, localPool) <- takeResource pool- failureOrSuccess <- act resource+ failureOrSuccess <- act resource `onException` destroyResource pool localPool resource case failureOrSuccess of Right success -> do putResource localPool resource
test/Main.hs view
@@ -15,15 +15,15 @@ it "releases a spot in the pool when there is an error" $ do pool <- acquire (1, 1, "host=localhost port=5432 user=postgres dbname=postgres") let- statement = Statement.Statement "" Encoders.unit Decoders.unit True+ statement = Statement.Statement "" Encoders.noParams Decoders.noResult True session = Session.statement () statement in do use pool session `shouldNotReturn` (Right ()) let session = let statement = let- decoder = Decoders.singleRow (Decoders.column Decoders.int8)- in Statement.Statement "SELECT 1" Encoders.unit decoder True+ decoder = Decoders.singleRow (Decoders.column (Decoders.nonNullable Decoders.int8))+ in Statement.Statement "SELECT 1" Encoders.noParams decoder True in Session.statement () statement in do use pool session `shouldReturn` (Right 1)