graphql-engine-1.0.0: GraphQL API over Postgres
Safe HaskellNone
LanguageHaskell2010

Hasura.Backends.Postgres.Execute.Types

Description

Postgres Execute Types

Execution context and source configuration for Postgres databases. Provides support for things such as read-only transactions and read replicas.

Synopsis

Documentation

type RunTx = forall m a. (MonadIO m, MonadBaseControl IO m) => TxET QErr m a -> ExceptT QErr m a Source #

data PGExecCtx Source #

Constructors

PGExecCtx 

Fields

mkPGExecCtx :: TxIsolation -> PGPool -> PGExecCtx Source #

Creates a Postgres execution context for a single Postgres master pool

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 #

Instances

Instances details
Eq PGSourceConfig Source # 
Instance details

Defined in Hasura.Backends.Postgres.Execute.Types

Generic PGSourceConfig Source # 
Instance details

Defined in Hasura.Backends.Postgres.Execute.Types

Associated Types

type Rep PGSourceConfig :: Type -> Type #

ToJSON PGSourceConfig Source # 
Instance details

Defined in Hasura.Backends.Postgres.Execute.Types

Methods

toJSON :: PGSourceConfig -> Value

toEncoding :: PGSourceConfig -> Encoding

toJSONList :: [PGSourceConfig] -> Value

toEncodingList :: [PGSourceConfig] -> Encoding

Cacheable PGSourceConfig Source # 
Instance details

Defined in Hasura.Backends.Postgres.Execute.Types

type Rep PGSourceConfig Source # 
Instance details

Defined in Hasura.Backends.Postgres.Execute.Types

type Rep PGSourceConfig = D1 ('MetaData "PGSourceConfig" "Hasura.Backends.Postgres.Execute.Types" "graphql-engine-1.0.0-inplace" 'False) (C1 ('MetaCons "PGSourceConfig" 'PrefixI 'True) ((S1 ('MetaSel ('Just "_pscExecCtx") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 PGExecCtx) :*: S1 ('MetaSel ('Just "_pscConnInfo") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 ConnInfo)) :*: (S1 ('MetaSel ('Just "_pscReadReplicaConnInfos") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe (NonEmpty ConnInfo))) :*: (S1 ('MetaSel ('Just "_pscPostDropHook") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (IO ())) :*: S1 ('MetaSel ('Just "_pscExtensionsSchema") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 ExtensionsSchema)))))

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 #