graphql-engine-1.0.0: GraphQL API over Postgres
Safe HaskellSafe-Inferred
LanguageHaskell2010

Hasura.Backends.BigQuery.FromIr

Description

Translate from the DML to the BigQuery dialect.

Synopsis

Documentation

data FromIr a Source #

The base monad used throughout this module for all conversion functions.

It's a Validate, so it'll continue going when it encounters errors to accumulate as many as possible.

It also contains a mapping from entity prefixes to counters. So if my prefix is "table" then there'll be a counter that lets me generate table1, table2, etc. Same for any other prefix needed (e.g. names for joins).

A ReaderT is used around this in most of the module too, for setting the current entity that a given field name refers to. See fromColumn.

Instances

Instances details
Applicative FromIr Source # 
Instance details

Defined in Hasura.Backends.BigQuery.FromIr

Methods

pure :: a -> FromIr a #

(<*>) :: FromIr (a -> b) -> FromIr a -> FromIr b #

liftA2 :: (a -> b -> c) -> FromIr a -> FromIr b -> FromIr c #

(*>) :: FromIr a -> FromIr b -> FromIr b #

(<*) :: FromIr a -> FromIr b -> FromIr a #

Functor FromIr Source # 
Instance details

Defined in Hasura.Backends.BigQuery.FromIr

Methods

fmap :: (a -> b) -> FromIr a -> FromIr b #

(<$) :: a -> FromIr b -> FromIr a #

Monad FromIr Source # 
Instance details

Defined in Hasura.Backends.BigQuery.FromIr

Methods

(>>=) :: FromIr a -> (a -> FromIr b) -> FromIr b #

(>>) :: FromIr a -> FromIr b -> FromIr b #

return :: a -> FromIr a #

MonadWriter FromIrWriter FromIr Source # 
Instance details

Defined in Hasura.Backends.BigQuery.FromIr

MonadValidate (NonEmpty Error) FromIr Source # 
Instance details

Defined in Hasura.Backends.BigQuery.FromIr

newtype FromIrWriter Source #

Collected from using a native query in a query. Each entry here because a CTE to be prepended to the query.

data FromIrConfig Source #

Config values for the from-IR translator.

Constructors

FromIrConfig 

Fields

  • globalSelectLimit :: Top

    Applies globally to all selects, and may be reduced to something even smaller by permission/user args.

mkSQLSelect :: JsonAggSelect -> AnnSelectG 'BigQuery (AnnFieldG 'BigQuery Void) Expression -> FromIr Select Source #

Here is where we apply a top-level annotation to the select to indicate to the data loader that this select ought to produce a single object or an array.

fromRootField :: QueryDB 'BigQuery Void Expression -> FromIr Select Source #

Convert from the IR database query into a select.