module Hasql.TransactionIO.Sessions (
  transactionIO,
  unpreparedTransactionIO,
  IsolationLevel(..),
  Mode(..),
  Deferrable(..),
) where

-- hasql
import Hasql.Session (Session)

-- hasql-streaming
import Hasql.Private.TransactionIO
import Hasql.Private.Types

-- | Run a prepared transaction with the given properties
transactionIO :: IsolationLevel -> Mode -> Deferrable -> TransactionIO a -> Session a
transactionIO :: forall a.
IsolationLevel
-> Mode -> Deferrable -> TransactionIO a -> Session a
transactionIO IsolationLevel
isolation Mode
mode Deferrable
deferrable TransactionIO a
txio = forall a.
TransactionIO a
-> IsolationLevel -> Mode -> Deferrable -> Bool -> Session a
run TransactionIO a
txio IsolationLevel
isolation Mode
mode Deferrable
deferrable Bool
True

-- | Run an unprepared transaction with the given properties
unpreparedTransactionIO :: IsolationLevel -> Mode -> Deferrable -> TransactionIO a -> Session a
unpreparedTransactionIO :: forall a.
IsolationLevel
-> Mode -> Deferrable -> TransactionIO a -> Session a
unpreparedTransactionIO IsolationLevel
isolation Mode
mode Deferrable
deferrable TransactionIO a
txio = forall a.
TransactionIO a
-> IsolationLevel -> Mode -> Deferrable -> Bool -> Session a
run TransactionIO a
txio IsolationLevel
isolation Mode
mode Deferrable
deferrable Bool
False