Safe Haskell | None |
---|---|
Language | Haskell2010 |
Stuff gutted from Translate.Select.
Synopsis
- mkFirstElementExp :: SQLExp -> SQLExp
- mkLastElementExp :: SQLExp -> SQLExp
- cursorIdentifier :: Identifier
- startCursorIdentifier :: Identifier
- endCursorIdentifier :: Identifier
- hasPreviousPageIdentifier :: Identifier
- hasNextPageIdentifier :: Identifier
- pageInfoSelectAliasIdentifier :: Identifier
- cursorsSelectAliasIdentifier :: Identifier
- encodeBase64 :: SQLExp -> SQLExp
- fromTableRowArgs :: Identifier -> FunctionArgsExpG (ArgumentExp SQLExp) -> FunctionArgs
- selectFromToFromItem :: Identifier -> SelectFrom ('Postgres pgKind) -> FromItem
- functionToIdentifier :: QualifiedFunction -> Identifier
- withJsonBuildObj :: FieldName -> [SQLExp] -> (ColumnAlias, SQLExp)
- withForceAggregation :: TypeAnn -> SQLExp -> SQLExp
Documentation
mkFirstElementExp :: SQLExp -> SQLExp Source #
First element extractor expression from given record set For example:- To get first "id" column from given row set, the function generates the SQL expression AS `(array_agg("id"))[1]`
mkLastElementExp :: SQLExp -> SQLExp Source #
Last element extractor expression from given record set. For example:- To get first "id" column from given row set, the function generates the SQL expression AS `(array_agg("id"))[array_length(array_agg("id"), 1)]`
encodeBase64 :: SQLExp -> SQLExp Source #
selectFromToFromItem :: Identifier -> SelectFrom ('Postgres pgKind) -> FromItem Source #
functionToIdentifier :: QualifiedFunction -> Identifier Source #
Converts a function name to an Identifier
.
If the schema name is public, it will just use its name, otherwise it will prefix it by the schema name.
withJsonBuildObj :: FieldName -> [SQLExp] -> (ColumnAlias, SQLExp) Source #