@@ -7,6 +7,7 @@ module Database.PostgreSQL.TransactionalStore
7
7
( PGTransaction
8
8
, TransactionalStore (.. )
9
9
, runPGTransaction
10
+ , runPGTransaction'
10
11
, query
11
12
, query_
12
13
, execute
@@ -22,6 +23,7 @@ import Control.Applicative
22
23
import Control.Monad.Reader
23
24
import Data.Int
24
25
import qualified Database.PostgreSQL.Simple as Postgres
26
+ import qualified Database.PostgreSQL.Simple.Transaction as Postgres.Transaction
25
27
import Database.PostgreSQL.Simple.FromRow
26
28
import Database.PostgreSQL.Simple.ToRow
27
29
@@ -34,9 +36,15 @@ newtype PGTransaction a =
34
36
, MonadReader Postgres.Connection
35
37
)
36
38
39
+ runPGTransaction' :: MonadIO m
40
+ => Postgres.Transaction. IsolationLevel
41
+ -> PGTransaction a
42
+ -> Postgres. Connection -> m a
43
+ runPGTransaction' isolation (PGTransaction pgTrans) conn =
44
+ liftIO (Postgres.Transaction. withTransactionLevel isolation conn (runReaderT pgTrans conn))
45
+
37
46
runPGTransaction :: MonadIO m => PGTransaction a -> Postgres. Connection -> m a
38
- runPGTransaction (PGTransaction pgTrans) conn =
39
- liftIO (Postgres. withTransaction conn (runReaderT pgTrans conn))
47
+ runPGTransaction = runPGTransaction' Postgres.Transaction. DefaultIsolationLevel
40
48
41
49
-- | Used to execute a `HeliumStore' `m' value inside of a transaction, with
42
50
-- connection/state `a', with effects in `n'.
0 commit comments