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

Hasura.Backends.Postgres.Translate.Select.Internal.Helpers

Description

Stuff gutted from Translate.Select.

Synopsis

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)]`

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.

withForceAggregation :: TypeAnn -> SQLExp -> SQLExp Source #

Forces aggregation