Safe Haskell | None |
---|---|
Language | Haskell2010 |
Postgres Execute Types
Execution context and source configuration for Postgres databases. Provides support for things such as read-only transactions and read replicas.
Synopsis
- type RunTx = forall m a. (MonadIO m, MonadBaseControl IO m) => TxET QErr m a -> ExceptT QErr m a
- data PGExecCtx = PGExecCtx {}
- mkPGExecCtx :: TxIsolation -> PGPool -> PGExecCtx
- defaultTxErrorHandler :: PGTxErr -> QErr
- dmlTxErrorHandler :: PGTxErr -> QErr
- mkTxErrorHandler :: (PGErrorType -> Bool) -> PGTxErr -> QErr
- data PGSourceConfig = PGSourceConfig {
- _pscExecCtx :: PGExecCtx
- _pscConnInfo :: ConnInfo
- _pscReadReplicaConnInfos :: Maybe (NonEmpty ConnInfo)
- _pscPostDropHook :: IO ()
- _pscExtensionsSchema :: ExtensionsSchema
- runPgSourceReadTx :: (MonadIO m, MonadBaseControl IO m) => PGSourceConfig -> TxET QErr m a -> m (Either QErr a)
- runPgSourceWriteTx :: (MonadIO m, MonadBaseControl IO m) => PGSourceConfig -> TxET QErr m a -> m (Either QErr a)
Documentation
type RunTx = forall m a. (MonadIO m, MonadBaseControl IO m) => TxET QErr m a -> ExceptT QErr m a Source #
PGExecCtx | |
|
mkPGExecCtx :: TxIsolation -> PGPool -> PGExecCtx Source #
Creates a Postgres execution context for a single Postgres master pool
defaultTxErrorHandler :: PGTxErr -> QErr Source #
dmlTxErrorHandler :: PGTxErr -> QErr Source #
Constructs a transaction error handler tailored for the needs of RQL's DML.
mkTxErrorHandler :: (PGErrorType -> Bool) -> PGTxErr -> QErr Source #
Constructs a transaction error handler given a predicate that determines which errors are expected and should be reported to the user. All other errors are considered internal errors.
data PGSourceConfig Source #
PGSourceConfig | |
|
Instances
runPgSourceReadTx :: (MonadIO m, MonadBaseControl IO m) => PGSourceConfig -> TxET QErr m a -> m (Either QErr a) Source #
runPgSourceWriteTx :: (MonadIO m, MonadBaseControl IO m) => PGSourceConfig -> TxET QErr m a -> m (Either QErr a) Source #