graphql-engine-1.0.0: GraphQL API over Postgres
Safe HaskellSafe-Inferred
LanguageHaskell2010

Hasura.Backends.Postgres.Translate.Select.Aggregate

Description

This module defines the top-level translation functions pertaining to queries that use aggregation (i.e., not so-called "simple" selects) into Postgres AST.

Synopsis

Documentation

selectAggregateQuerySQL :: forall pgKind. (Backend ('Postgres pgKind), PostgresAnnotatedFieldJSON pgKind) => AnnAggregateSelect ('Postgres pgKind) -> Query Source #

Translates IR to Postgres queries for aggregated SELECTs.

See mkAggregateSelect for the Postgres AST.

mkAggregateSelect :: forall pgKind m. (Backend ('Postgres pgKind), PostgresAnnotatedFieldJSON pgKind, MonadWriter CustomSQLCTEs m) => AnnAggregateSelect ('Postgres pgKind) -> m Select Source #

We process aggregate queries differently because the types of aggregate queries are different. In the _asnFields field of an AnnSelectG, we will have a TableAggregateFieldG instead of an AnnFieldG.