postgresql-tx-query-0.3.0.0: postgresql-tx interfacing for use with postgresql-query.
Safe HaskellNone
LanguageHaskell2010

Database.PostgreSQL.Tx.Query

Synopsis

Documentation

type PgQueryEnv r = TxEnvs '[Connection, Logger] r :: Constraint Source #

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

Since: 0.2.0.0

type PgQueryM a = forall r. PgQueryEnv r => TxM r a Source #

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

Since: 0.2.0.0

type Logger = Logger Source #

Re-export of Logger.

Since: 0.1.0.0

pgWithTransaction :: (PgQueryEnv r, HasCallStack) => r -> (HasCallStack => TxM r a) -> IO a Source #

Analogue of pgWithTransaction.

Since: 0.1.0.0

pgWithTransactionMode :: (PgQueryEnv r, HasCallStack) => TransactionMode -> r -> (HasCallStack => TxM r a) -> IO a Source #

Analogue of pgWithTransactionMode.

Since: 0.1.0.0

pgWithTransactionSerializable :: (PgQueryEnv r, HasCallStack) => r -> (HasCallStack => TxM r a) -> IO a Source #

Analogue of pgWithTransactionSerializable Unlike postgresql-query, 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

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

Analogue of pgWithTransactionModeRetry. You should generally prefer pgWithTransactionSerializable.

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

Since: 0.2.0.0

pgWithSavepoint :: (HasCallStack => PgQueryM a) -> PgQueryM a Source #

Analogue of pgWithSavepoint.

Since: 0.2.0.0

pgQuery :: (ToSqlBuilder q, FromRow r, HasCallStack) => q -> PgQueryM [r] Source #

Analogue of pgQuery.

Since: 0.1.0.0

pgQueryWithMasker :: (ToSqlBuilder q, FromRow r, HasCallStack) => LogMasker -> q -> PgQueryM [r] Source #

Analogue of pgQueryWithMasker.

Since: 0.2.0.0

pgExecute :: (ToSqlBuilder q, HasCallStack) => q -> PgQueryM Int64 Source #

Analogue of pgExecute.

Since: 0.1.0.0