Safe Haskell | None |
---|---|
Language | Haskell2010 |
Postgres Translate BoolExp
Convert IR boolean expressions to Postgres-specific SQL expressions.
Synopsis
- equalsBoolExpBuilder :: SQLExpression ('Postgres pgKind) -> SQLExpression ('Postgres pgKind) -> BoolExp
- notEqualsBoolExpBuilder :: SQLExpression ('Postgres pgKind) -> SQLExpression ('Postgres pgKind) -> BoolExp
- annBoolExp :: (QErrM m, TableCoreInfoRM b m, BackendMetadata b) => BoolExpRHSParser b m v -> TableName b -> FieldInfoMap (FieldInfo b) -> GBoolExp b ColExp -> m (AnnBoolExp b v)
- annColExp :: (QErrM m, TableCoreInfoRM b m, BackendMetadata b) => BoolExpRHSParser b m v -> TableName b -> FieldInfoMap (FieldInfo b) -> ColExp -> m (AnnBoolExpFld b v)
- toSQLBoolExp :: forall pgKind. Backend ('Postgres pgKind) => Qual -> AnnBoolExpSQL ('Postgres pgKind) -> BoolExp
- data BoolExpCtx = BoolExpCtx {}
- newtype BoolExpM a = BoolExpM {
- unBoolExpM :: ReaderT BoolExpCtx (State Word64) a
- translateBoolExp :: forall pgKind. Backend ('Postgres pgKind) => AnnBoolExpSQL ('Postgres pgKind) -> BoolExpM BoolExp
- data LHSField b
- mkComputedFieldFunctionExp :: Qual -> QualifiedFunction -> FunctionArgsExp ('Postgres pgKind) (SQLExpression ('Postgres pgKind)) -> Maybe TableAlias -> FunctionExp
- mkFieldCompExp :: Qual -> Qual -> LHSField ('Postgres pgKind) -> OpExpG ('Postgres pgKind) SQLExp -> BoolExp
Documentation
equalsBoolExpBuilder :: SQLExpression ('Postgres pgKind) -> SQLExpression ('Postgres pgKind) -> BoolExp Source #
notEqualsBoolExpBuilder :: SQLExpression ('Postgres pgKind) -> SQLExpression ('Postgres pgKind) -> BoolExp Source #
annBoolExp :: (QErrM m, TableCoreInfoRM b m, BackendMetadata b) => BoolExpRHSParser b m v -> TableName b -> FieldInfoMap (FieldInfo b) -> GBoolExp b ColExp -> m (AnnBoolExp b v) Source #
annColExp :: (QErrM m, TableCoreInfoRM b m, BackendMetadata b) => BoolExpRHSParser b m v -> TableName b -> FieldInfoMap (FieldInfo b) -> ColExp -> m (AnnBoolExpFld b v) Source #
:: 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.
BoolExpCtx | |
|
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.
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.
mkComputedFieldFunctionExp :: Qual -> QualifiedFunction -> FunctionArgsExp ('Postgres pgKind) (SQLExpression ('Postgres pgKind)) -> Maybe TableAlias -> FunctionExp Source #