hasql-pool 0.7.1.2 → 0.7.1.3
raw patch · 3 files changed
+14/−9 lines, 3 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
Files
- CHANGELOG.md +4/−0
- hasql-pool.cabal +1/−1
- library/Hasql/Pool.hs +9/−8
CHANGELOG.md view
@@ -1,3 +1,7 @@+# 0.7.1.2++Fixed connections not being released if they were in use during the call to `release`.+ # 0.7.1 Added `Exception` for `UsageError`.
hasql-pool.cabal view
@@ -1,7 +1,7 @@ name: hasql-pool version:- 0.7.1.2+ 0.7.1.3 category: Hasql, Database, PostgreSQL synopsis:
library/Hasql/Pool.hs view
@@ -16,8 +16,7 @@ import Hasql.Session (Session) import qualified Hasql.Session as Session --- |--- A pool of connections to DB.+-- | A pool of connections to DB. data Pool = Pool { -- | Connection settings. poolConnectionSettings :: Connection.Settings,@@ -51,7 +50,7 @@ -- | Use a connection from the pool to run a session and return the connection -- to the pool, when finished. ----- Session failing with a 'Session.ClientError' get interpreted as a loss of+-- Session failing with a 'Session.ClientError' gets interpreted as a loss of -- connection. In such case the connection does not get returned to the pool -- and a slot gets freed up for a new connection to be established the next -- time one is needed. The error still gets returned from this function.@@ -101,12 +100,14 @@ then writeTQueue poolConnectionQueue conn $> return () else return $ Connection.release conn --- |--- A union over the connection establishment error and the session error.+-- | Union over all errors that 'use' can result in. data UsageError- = ConnectionUsageError Connection.ConnectionError- | SessionUsageError Session.QueryError- | PoolIsReleasedUsageError+ = -- | Attempt to establish a connection failed.+ ConnectionUsageError Connection.ConnectionError+ | -- | Session execution failed.+ SessionUsageError Session.QueryError+ | -- | Attempt to use a pool, which has already been called 'release' upon.+ PoolIsReleasedUsageError deriving (Show, Eq) instance Exception UsageError