Safe Haskell | None |
---|---|
Language | Haskell2010 |
This module translates the IR of boolean expressions into TSQL boolean expressions.
Boolean expressions typically arise from permissions and where-clause filters.
Synopsis
- fromGBoolExp :: GBoolExp 'MSSQL (AnnBoolExpFld 'MSSQL Expression) -> ReaderT EntityAlias FromIr Expression
- fromAnnBoolExpFld :: AnnBoolExpFld 'MSSQL Expression -> ReaderT EntityAlias FromIr Expression
- scopedTo :: From -> ReaderT EntityAlias FromIr a -> ReaderT EntityAlias FromIr a
- fromColumnInfo :: ColumnInfo 'MSSQL -> ReaderT EntityAlias FromIr Expression
- fromColumn :: ColumnName -> ReaderT EntityAlias FromIr FieldName
- fromOpExpG :: ColumnInfo 'MSSQL -> OpExpG 'MSSQL Expression -> ReaderT EntityAlias FromIr Expression
- nullableBoolEquality :: Expression -> Expression -> Expression
- nullableBoolInequality :: Expression -> Expression -> Expression
- aliasQualifiedTable :: TableName -> FromIr From
Documentation
fromGBoolExp :: GBoolExp 'MSSQL (AnnBoolExpFld 'MSSQL Expression) -> ReaderT EntityAlias FromIr Expression Source #
Translate boolean expressions into TSQL Expression
s.
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 Expression
s.
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.