Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Postgres Connection MonadTx
This module contains MonadTx
and related combinators.
MonadTx
, a class which abstracts the QErr
in TxE
via MonadError
.
The combinators are used for running, tracing, or otherwise perform database related tasks. Please consult the individual documentation for more information.
Synopsis
- class MonadError QErr m => MonadTx m where
- runTxWithCtx :: (MonadIO m, MonadBaseControl IO m, MonadError QErr m, MonadTrace m, UserInfoM m) => PGExecCtx -> PGExecTxType -> PGExecFrom -> TxET QErr m a -> m a
- runTxWithCtxAndUserInfo :: (MonadIO m, MonadBaseControl IO m, MonadError QErr m, MonadTrace m) => UserInfo -> PGExecCtx -> PGExecTxType -> PGExecFrom -> TxET QErr m a -> m a
- runQueryTx :: (MonadIO m, MonadBaseControl IO m, MonadError QErr m) => PGExecCtx -> PGExecFrom -> TxET QErr m a -> m a
- setHeadersTx :: MonadIO m => SessionVariables -> TxET QErr m ()
- sessionInfoJsonExp :: SessionVariables -> SQLExp
- withUserInfo :: MonadIO m => UserInfo -> TxET QErr m a -> TxET QErr m a
- setTraceContextInTx :: MonadIO m => Maybe TraceContext -> TxET QErr m ()
- withTraceContext :: MonadIO m => Maybe TraceContext -> TxET QErr m a -> TxET QErr m a
- checkDbConnection :: MonadTx m => m ()
- doesSchemaExist :: MonadTx m => SchemaName -> m Bool
- doesTableExist :: MonadTx m => SchemaName -> TableName -> m Bool
- enablePgcryptoExtension :: forall m. MonadTx m => ExtensionsSchema -> m ()
- dropHdbCatalogSchema :: MonadTx m => m ()
Documentation
class MonadError QErr m => MonadTx m where Source #
Instances
MonadTx m => MonadTx (MetadataT m) Source # | |
MonadTx m => MonadTx (TraceT m) Source # | |
MonadTx m => MonadTx (TableCacheRT b m) Source # | |
Defined in Hasura.RQL.Types.SchemaCache | |
MonadTx m => MonadTx (TableCoreCacheRT b m) Source # | |
Defined in Hasura.RQL.Types.SchemaCache | |
MonadTx m => MonadTx (ValidateT e m) Source # | |
MonadIO m => MonadTx (TxET QErr m) Source # | |
MonadTx m => MonadTx (ReaderT s m) Source # | |
MonadTx m => MonadTx (StateT s m) Source # | |
(Monoid w, MonadTx m) => MonadTx (WriterT w m) Source # | |
runTxWithCtx :: (MonadIO m, MonadBaseControl IO m, MonadError QErr m, MonadTrace m, UserInfoM m) => PGExecCtx -> PGExecTxType -> PGExecFrom -> TxET QErr m a -> m a Source #
runTxWithCtxAndUserInfo :: (MonadIO m, MonadBaseControl IO m, MonadError QErr m, MonadTrace m) => UserInfo -> PGExecCtx -> PGExecTxType -> PGExecFrom -> TxET QErr m a -> m a Source #
runQueryTx :: (MonadIO m, MonadBaseControl IO m, MonadError QErr m) => PGExecCtx -> PGExecFrom -> TxET QErr m a -> m a Source #
This runs the given set of statements (Tx) without wrapping them in BEGIN and COMMIT. This should only be used for running a single statement query!
setHeadersTx :: MonadIO m => SessionVariables -> TxET QErr m () Source #
setTraceContextInTx :: MonadIO m => Maybe TraceContext -> TxET QErr m () Source #
withTraceContext :: MonadIO m => Maybe TraceContext -> TxET QErr m a -> TxET QErr m a Source #
Inject the trace context as a transaction-local variable, so that it can be picked up by any triggers (including event triggers).
checkDbConnection :: MonadTx m => m () Source #
doesSchemaExist :: MonadTx m => SchemaName -> m Bool Source #
doesTableExist :: MonadTx m => SchemaName -> TableName -> m Bool Source #
enablePgcryptoExtension :: forall m. MonadTx m => ExtensionsSchema -> m () Source #
dropHdbCatalogSchema :: MonadTx m => m () Source #
Orphan instances
MonadTrace m => MonadTrace (TxET e m) Source # | |
newTraceWith :: TraceContext -> SamplingPolicy -> Text -> TxET e m a -> TxET e m a Source # newSpanWith :: SpanId -> Text -> TxET e m a -> TxET e m a Source # currentContext :: TxET e m (Maybe TraceContext) Source # attachMetadata :: TraceMetadata -> TxET e m () Source # |