graphql-engine-1.0.0: GraphQL API over Postgres
Safe HaskellSafe-Inferred
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

data PGExecCtx Source #

Constructors

PGExecCtx 

Fields

data PGExecCtxInfo Source #

Holds the information required to exceute a PG transaction

Constructors

PGExecCtxInfo 

Fields

data PGExecTxType Source #

The tranasction mode (isolation level, transaction access) for executing the transaction

Constructors

NoTxRead

a transaction without an explicit tranasction block

Tx TxAccess (Maybe TxIsolation)

a transaction block with custom transaction access and isolation level. Choose defaultIsolationLevel defined in SourceConnConfiguration if Nothing is provided for isolation level.

data PGExecFrom Source #

The level from where the transaction is being run

Constructors

GraphQLQuery (Maybe PostgresResolvedConnectionTemplate)

transaction initated via a GraphQLRequest

RunSQLQuery

transaction initiated during run_sql

InternalRawQuery

custom transaction Hasura runs on the database. This is usually used in event_trigger and actions

LegacyRQLQuery

transactions initiated via other API's other than run_sql in v1query or v2query

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

Creates a Postgres execution context for a single Postgres master pool

resizePostgresPool :: PGPool -> Int -> ServerReplicas -> IO () Source #

Resize Postgres pool by setting the number of connections equal to allowed maximum connections across all server instances divided by number of instances

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.

newtype ConnectionTemplateResolver Source #

A hook to resolve connection template

Constructors

ConnectionTemplateResolver 

Fields

data PGSourceConfig Source #

Instances

Instances details
ToJSON 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 #

Show PGSourceConfig Source # 
Instance details

Defined in Hasura.Backends.Postgres.Execute.Types

Eq PGSourceConfig Source # 
Instance details

Defined in Hasura.Backends.Postgres.Execute.Types

Has () PGSourceConfig Source # 
Instance details

Defined in Hasura.Backends.Postgres.Execute.Types

type Rep PGSourceConfig Source # 
Instance details

Defined in Hasura.Backends.Postgres.Execute.Types