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

Hasura.Backends.Postgres.Instances.Execute

Description

Postgres Instances Execute

This module implements the needed functionality for implementing a BackendExecute instance for Postgres, which defines an interface for translating a root field into an execution plan and interacting with a database.

This module includes the Postgres implementation of queries, mutations, and more.

Synopsis

Documentation

data PreparedSql Source #

Constructors

PreparedSql 

Fields

convertFunction Source #

Arguments

:: forall pgKind m. (MonadError QErr m, Backend ('Postgres pgKind), PostgresAnnotatedFieldJSON pgKind, MonadReader QueryTagsComment m) 
=> UserInfo 
-> JsonAggSelect 
-> AnnSimpleSelectG ('Postgres pgKind) Void (UnpreparedValue ('Postgres pgKind))

VOLATILE function as SelectExp

-> m (TraceT (TxET QErr IO) EncJSON) 

A pared-down version of convertQuerySelSet, for use in execution of special case of SQL function mutations (see MDBFunction).

asSingleRowJsonResp :: Query -> [PrepArg] -> TxE QErr EncJSON Source #

This function is generally used on the result of selectQuerySQL, selectAggregateQuerySQL or connectionSelectSQL to run said query and get back the resulting JSON.

pgDBRemoteRelationshipPlan Source #

Arguments

:: forall pgKind m. (MonadError QErr m, Backend ('Postgres pgKind), PostgresAnnotatedFieldJSON pgKind) 
=> UserInfo 
-> SourceName 
-> SourceConfig ('Postgres pgKind) 
-> NonEmpty Object

List of json objects, each of which becomes a row of the table.

-> HashMap FieldName (Column ('Postgres pgKind), ScalarType ('Postgres pgKind))

The above objects have this schema

XXX: What is this for/what does this mean?

-> FieldName

This is a field name from the lhs that *has* to be selected in the response along with the relationship.

-> (FieldName, SourceRelationshipSelection ('Postgres pgKind) Void UnpreparedValue) 
-> m (DBStepInfo ('Postgres pgKind)) 

Construct an action (i.e. DBStepInfo) which can marshal some remote relationship information into a form that Postgres can query against.

Orphan instances

(Backend ('Postgres pgKind), PostgresAnnotatedFieldJSON pgKind) => BackendExecute ('Postgres pgKind) Source # 
Instance details

Associated Types

type PreparedQuery ('Postgres pgKind) Source #

type MultiplexedQuery ('Postgres pgKind) Source #

type ExecutionMonad ('Postgres pgKind) :: Type -> Type Source #

Methods

mkDBQueryPlan :: (MonadError QErr m, MonadQueryTags m, MonadReader QueryTagsComment m) => UserInfo -> Environment -> SourceName -> SourceConfig ('Postgres pgKind) -> QueryDB ('Postgres pgKind) Void (UnpreparedValue ('Postgres pgKind)) -> m (DBStepInfo ('Postgres pgKind)) Source #

mkDBMutationPlan :: (MonadError QErr m, MonadQueryTags m, MonadReader QueryTagsComment m) => UserInfo -> StringifyNumbers -> SourceName -> SourceConfig ('Postgres pgKind) -> MutationDB ('Postgres pgKind) Void (UnpreparedValue ('Postgres pgKind)) -> m (DBStepInfo ('Postgres pgKind)) Source #

mkLiveQuerySubscriptionPlan :: (MonadError QErr m, MonadIO m, MonadBaseControl IO m, MonadReader QueryTagsComment m) => UserInfo -> SourceName -> SourceConfig ('Postgres pgKind) -> Maybe Name -> RootFieldMap (QueryDB ('Postgres pgKind) Void (UnpreparedValue ('Postgres pgKind))) -> m (SubscriptionQueryPlan ('Postgres pgKind) (MultiplexedQuery ('Postgres pgKind))) Source #

mkDBStreamingSubscriptionPlan :: (MonadError QErr m, MonadIO m, MonadBaseControl IO m, MonadReader QueryTagsComment m) => UserInfo -> SourceName -> SourceConfig ('Postgres pgKind) -> (RootFieldAlias, QueryDB ('Postgres pgKind) Void (UnpreparedValue ('Postgres pgKind))) -> m (SubscriptionQueryPlan ('Postgres pgKind) (MultiplexedQuery ('Postgres pgKind))) Source #

mkDBQueryExplain :: MonadError QErr m => RootFieldAlias -> UserInfo -> SourceName -> SourceConfig ('Postgres pgKind) -> QueryDB ('Postgres pgKind) Void (UnpreparedValue ('Postgres pgKind)) -> m (AnyBackend DBStepInfo) Source #

mkSubscriptionExplain :: (MonadError QErr m, MonadIO m, MonadBaseControl IO m) => SubscriptionQueryPlan ('Postgres pgKind) (MultiplexedQuery ('Postgres pgKind)) -> m SubscriptionQueryPlanExplanation Source #

mkDBRemoteRelationshipPlan :: (MonadError QErr m, MonadQueryTags m) => UserInfo -> SourceName -> SourceConfig ('Postgres pgKind) -> NonEmpty Object -> HashMap FieldName (Column ('Postgres pgKind), ScalarType ('Postgres pgKind)) -> FieldName -> (FieldName, SourceRelationshipSelection ('Postgres pgKind) Void UnpreparedValue) -> m (DBStepInfo ('Postgres pgKind)) Source #