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

Hasura.Backends.MSSQL.FromIr.Expression

Description

This module translates the IR of boolean expressions into TSQL boolean expressions.

Boolean expressions typically arise from permissions and where-clause filters.

Synopsis

Documentation

fromGBoolExp :: GBoolExp 'MSSQL (AnnBoolExpFld 'MSSQL Expression) -> ReaderT EntityAlias FromIr Expression Source #

Translate boolean expressions into TSQL Expressions.

The AnnBoolExpFld references fields and columns. The entity (e.g. table) that binds these columns is supplied in the `ReaderT EntityAlias` environment, such that the columns can be referred to unambiguously.

fromAnnBoolExpFld :: AnnBoolExpFld 'MSSQL Expression -> ReaderT EntityAlias FromIr Expression Source #

Translate boolean expressions into TSQL Expressions.

The AnnBoolExpFld references fields and columns. The entity (e.g. table) that binds these columns is supplied in the `ReaderT EntityAlias` environment, such that the columns can be referred to unambiguously.

scopedTo :: From -> ReaderT EntityAlias FromIr a -> ReaderT EntityAlias FromIr a Source #

Scope a translation action to the table bound in a FROM clause.

fromColumnInfo :: ColumnInfo 'MSSQL -> ReaderT EntityAlias FromIr Expression Source #

Translate a column reference occurring in a boolean expression into an equivalent Expression.

Different text types support different operators. Therefore we cast some text types to "varchar(max)", which supports the most operators.

fromColumn :: ColumnName -> ReaderT EntityAlias FromIr FieldName Source #

Get FieldSource from a TAFExp type table aggregate field

fromOpExpG :: ColumnInfo 'MSSQL -> OpExpG 'MSSQL Expression -> ReaderT EntityAlias FromIr Expression Source #

Translate a single OpExpG operation on a column into an expression.