-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | postgresql-tx interfacing for use with postgresql-simple. -- -- Please see the README on GitHub at -- https://github.com/simspace/postgresql-tx#readme @package postgresql-tx-simple @version 0.2.0.0 module Database.PostgreSQL.Tx.Simple.Internal -- | Monad type alias for running postgresql-simple via -- postgresql-tx. type PgSimpleM a = forall r. (PgSimpleEnv r) => TxM r a -- | Runtime environment needed to run postgresql-simple via -- postgresql-tx. type PgSimpleEnv r = (TxEnv Connection r) :: Constraint unsafeRunTransaction :: PgSimpleEnv r => (Connection -> IO a -> IO a) -> r -> TxM r a -> IO a fromSqlError :: SqlError -> TxException unsafeFromPgSimple :: (Connection -> IO x) -> PgSimpleM x unsafeFromPgSimple1 :: (Connection -> a1 -> IO x) -> a1 -> PgSimpleM x unsafeFromPgSimple2 :: (Connection -> a1 -> a2 -> IO x) -> a1 -> a2 -> PgSimpleM x module Database.PostgreSQL.Tx.Simple -- | Runtime environment needed to run postgresql-simple via -- postgresql-tx. type PgSimpleEnv r = (TxEnv Connection r) :: Constraint -- | Monad type alias for running postgresql-simple via -- postgresql-tx. type PgSimpleM a = forall r. (PgSimpleEnv r) => TxM r a -- | Analogue of withTransaction. withTransaction :: (PgSimpleEnv r, HasCallStack) => r -> (HasCallStack => TxM r a) -> IO a -- | Analogue of withTransactionLevel. withTransactionLevel :: (PgSimpleEnv r, HasCallStack) => IsolationLevel -> r -> (HasCallStack => TxM r a) -> IO a -- | Analogue of withTransactionMode. withTransactionMode :: (PgSimpleEnv r, HasCallStack) => TransactionMode -> r -> (HasCallStack => TxM r a) -> IO a -- | Analogue of withTransactionSerializable. Unlike -- postgresql-simple, uses shouldRetryTx to also retry on -- deadlock_detected, not just serialization_failure. -- -- Note that any IO that occurs inside the TxM may be -- executed multiple times. withTransactionSerializable :: (PgSimpleEnv r, HasCallStack) => r -> (HasCallStack => TxM r a) -> IO a -- | Analogue of withTransactionModeRetry. You should generally -- prefer withTransactionSerializable. -- -- Note that any IO that occurs inside the TxM may be -- executed multiple times. withTransactionModeRetry :: (Exception e, PgSimpleEnv r, HasCallStack) => TransactionMode -> (e -> Bool) -> r -> (HasCallStack => TxM r a) -> IO a -- | Analogue of query query :: (ToRow q, FromRow x) => Query -> q -> PgSimpleM [x] -- | Analogue of query_. query_ :: FromRow x => Query -> PgSimpleM [x] -- | Analogue of execute. execute :: ToRow q => Query -> q -> PgSimpleM Int64 -- | Analogue of execute_. execute_ :: Query -> PgSimpleM Int64