git.iko.soy/typeable/postgresql-simple
on master help sign in
Export +withTransactionModeRetry', style changes
22b3bb4Oleg Grenrus
CHANGES.md+7
@@ -9,6 +9,13 @@
9 * Add `Identity` and `Const` instance
9 * Add `Identity` and `Const` instance
10 Thanks to Cary Robbins for the implementation
10 Thanks to Cary Robbins for the implementation
11 https://github.com/haskellari/postgresql-simple/pull/46
11 https://github.com/haskellari/postgresql-simple/pull/46
12+ * Add `withTransactionModeRetry'`, a variant of `withTransactionModeRetry`
13+ for all exception types.
14+ Thanks to Elliot Cameron for the implementation
15+ https://github.com/haskellari/postgresql-simple/pull/42
16+ * Fix spurious aborts when retrying transactions
17+ Thanks to Elliot Cameron for the implementation
18+ https://github.com/haskellari/postgresql-simple/pull/34
12
19
13### Version 0.6.2 (2019-04-26)
20### Version 0.6.2 (2019-04-26)
14
21
src/Database/PostgreSQL/Simple/Transaction.hs+2−1
@@ -17,6 +17,7 @@ module Database.PostgreSQL.Simple.Transaction
17 , withTransactionLevel
17 , withTransactionLevel
18 , withTransactionMode
18 , withTransactionMode
19 , withTransactionModeRetry
19 , withTransactionModeRetry
20+ , withTransactionModeRetry'
20 , withTransactionSerializable
21 , withTransactionSerializable
21 , TransactionMode(..)
22 , TransactionMode(..)
22 , IsolationLevel(..)
23 , IsolationLevel(..)
@@ -147,7 +148,7 @@ withTransactionMode mode conn act =
147 return r
148 return r
148
149
149-- | 'withTransactionModeRetry'' but with the exception type pinned to 'SqlError'.
150-- | 'withTransactionModeRetry'' but with the exception type pinned to 'SqlError'.
150−withTransactionModeRetry :: forall a. TransactionMode -> (SqlError -> Bool) -> Connection -> IO a -> IO a
151+withTransactionModeRetry :: TransactionMode -> (SqlError -> Bool) -> Connection -> IO a -> IO a
151withTransactionModeRetry = withTransactionModeRetry'
152withTransactionModeRetry = withTransactionModeRetry'
152
153
153-- | Like 'withTransactionMode', but also takes a custom callback to
154-- | Like 'withTransactionMode', but also takes a custom callback to