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

Hasura.Backends.MySQL.DataLoader.Execute

Description

Execute the plan given from .Plan.

Synopsis

Documentation

data RecordSet Source #

A set of records produced by the database. These are joined together. There are all sorts of optimizations possible here, from using a matrix/flat vector, unboxed sums for Value, etc. Presently we choose a naive implementation in the interest of getting other work done.

Constructors

RecordSet 

Fields

Instances

Instances details
Show RecordSet Source # 
Instance details

Defined in Hasura.Backends.MySQL.DataLoader.Execute

(TypeError ('Text "Aeson loses key order, so you can't use this instance.") :: Constraint) => ToJSON RecordSet Source # 
Instance details

Defined in Hasura.Backends.MySQL.DataLoader.Execute

Methods

toJSON :: RecordSet -> Value

toEncoding :: RecordSet -> Encoding

toJSONList :: [RecordSet] -> Value

toEncodingList :: [RecordSet] -> Encoding

data ExecuteReader Source #

The read-only info. used by the Execute monad. Later, this IORef may become either atomically modified or in an STM or MVar so that jobs can be executed in parallel.

Constructors

ExecuteReader 

Fields

newtype Execute a Source #

Execute monad; as queries are performed, the record sets are stored in the map.

data OutputValue Source #

A value outputted by this execute module in a record set.

Instances

Instances details
Eq OutputValue Source # 
Instance details

Defined in Hasura.Backends.MySQL.DataLoader.Execute

Show OutputValue Source # 
Instance details

Defined in Hasura.Backends.MySQL.DataLoader.Execute

Generic OutputValue Source # 
Instance details

Defined in Hasura.Backends.MySQL.DataLoader.Execute

Associated Types

type Rep OutputValue :: Type -> Type #

Hashable OutputValue Source # 
Instance details

Defined in Hasura.Backends.MySQL.DataLoader.Execute

type Rep OutputValue Source # 
Instance details

Defined in Hasura.Backends.MySQL.DataLoader.Execute

type Rep OutputValue = D1 ('MetaData "OutputValue" "Hasura.Backends.MySQL.DataLoader.Execute" "graphql-engine-1.0.0-inplace" 'False) ((C1 ('MetaCons "ArrayOutputValue" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Vector OutputValue))) :+: C1 ('MetaCons "RecordOutputValue" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (InsOrdHashMap FieldName OutputValue)))) :+: (C1 ('MetaCons "ScalarOutputValue" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Value)) :+: C1 ('MetaCons "NullOutputValue" 'PrefixI 'False) (U1 :: Type -> Type)))

runExecute :: MonadIO m => SourceConfig -> HeadAndTail -> Execute a -> m (Either ExecuteProblem RecordSet) Source #

Using the config, run the execute action. Finally, resolve the head-and-tail to a record set.

execute :: Forest PlannedAction -> Execute () Source #

Execute the forest of actions.

executePlannedAction :: PlannedAction -> Execute () Source #

Execute an action, then store its result in the ref assigned to it.

fetchRecordSetForAction :: Action -> Execute RecordSet Source #

Fetch the record set for the given action.

makeRecordSet :: Vector (InsOrdHashMap FieldName Value) -> RecordSet Source #

Make a record set from a flat record from the DB.

leftObjectJoin :: Maybe [Text] -> Text -> [(FieldName, FieldName)] -> RecordSet -> RecordSet -> Either ExecuteProblem RecordSet Source #

Inefficient but clean left object join.

leftArrayJoin :: Maybe [Text] -> Text -> [(FieldName, FieldName)] -> Top -> Maybe Int -> RecordSet -> RecordSet -> Either ExecuteProblem RecordSet Source #

A naive, exponential reference implementation of a left join. It serves as a trivial sample implementation for correctness checking of more efficient ones.

joinArrayRows :: Maybe [Text] -> Text -> InsOrdHashMap FieldName OutputValue -> Vector (InsOrdHashMap FieldName OutputValue) -> InsOrdHashMap FieldName OutputValue Source #

Join a row with another as an array join.

joinObjectRows :: Maybe [Text] -> Text -> InsOrdHashMap FieldName OutputValue -> Vector (InsOrdHashMap FieldName OutputValue) -> Either ExecuteProblem (InsOrdHashMap FieldName OutputValue) Source #

Join a row with another as an object join.

If rightRow is not a single row, we throw BrokenJoinInvariant.