postgresql-tx-simple-0.2.0.0: postgresql-tx interfacing for use with postgresql-simple.
Safe HaskellNone
LanguageHaskell2010

Database.PostgreSQL.Tx.Simple

Synopsis

Documentation

type PgSimpleEnv r = TxEnv Connection r :: Constraint Source #

Runtime environment needed to run postgresql-simple via postgresql-tx.

Since: 0.2.0.0

type PgSimpleM a = forall r. PgSimpleEnv r => TxM r a Source #

Monad type alias for running postgresql-simple via postgresql-tx.

Since: 0.2.0.0

withTransaction :: (PgSimpleEnv r, HasCallStack) => r -> (HasCallStack => TxM r a) -> IO a Source #

Analogue of withTransaction.

Since: 0.1.0.0

withTransactionLevel :: (PgSimpleEnv r, HasCallStack) => IsolationLevel -> r -> (HasCallStack => TxM r a) -> IO a Source #

Analogue of withTransactionLevel.

Since: 0.1.0.0

withTransactionMode :: (PgSimpleEnv r, HasCallStack) => TransactionMode -> r -> (HasCallStack => TxM r a) -> IO a Source #

Analogue of withTransactionMode.

Since: 0.2.0.0

withTransactionSerializable :: (PgSimpleEnv r, HasCallStack) => r -> (HasCallStack => TxM r a) -> IO a Source #

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.

Since: 0.2.0.0

withTransactionModeRetry :: (Exception e, PgSimpleEnv r, HasCallStack) => TransactionMode -> (e -> Bool) -> r -> (HasCallStack => TxM r a) -> IO a Source #

Analogue of withTransactionModeRetry. You should generally prefer withTransactionSerializable.

Note that any IO that occurs inside the TxM may be executed multiple times.

Since: 0.2.0.0

query :: (ToRow q, FromRow x) => Query -> q -> PgSimpleM [x] Source #

Analogue of query

Since: 0.1.0.0

query_ :: FromRow x => Query -> PgSimpleM [x] Source #

Analogue of query_.

Since: 0.1.0.0

execute :: ToRow q => Query -> q -> PgSimpleM Int64 Source #

Analogue of execute.

Since: 0.1.0.0

execute_ :: Query -> PgSimpleM Int64 Source #

Analogue of execute_.

Since: 0.1.0.0