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

Hasura.Backends.Postgres.Translate.BoolExp

Description

Postgres Translate BoolExp

Convert IR boolean expressions to Postgres-specific SQL expressions.

Synopsis

Documentation

toSQLBoolExp Source #

Arguments

:: forall pgKind. Backend ('Postgres pgKind) 
=> Qual

The name of the tabular value in query scope that the boolean expression applies to

-> AnnBoolExpSQL ('Postgres pgKind)

The boolean expression to translate

-> BoolExp 

Translate an IR boolean expression to an SQL boolean expression. References to columns etc are relative to the given rootReference.

data BoolExpCtx Source #

The table context of boolean expression translation. This is used to resolve references to fields, as those may refer to the so-called 'root table' (identified by a $-sign in the expression input syntax) or the current table.

Constructors

BoolExpCtx 

Fields

newtype BoolExpM a Source #

The monad that carries the translation of boolean expressions. This supports the generation of fresh names for aliasing sub-expressions and maintains the table context of the expressions being translated.

Constructors

BoolExpM 

translateBoolExp :: forall pgKind. Backend ('Postgres pgKind) => AnnBoolExpSQL ('Postgres pgKind) -> BoolExpM BoolExp Source #

Translate a GBoolExp with annotated SQLExpressions in the leaves into a bare SQL Boolean Expression.