Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
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
- selectAggregateQuerySQL :: forall pgKind. (Backend ('Postgres pgKind), PostgresAnnotatedFieldJSON pgKind) => AnnAggregateSelect ('Postgres pgKind) -> Query
- mkAggregateSelect :: forall pgKind m. (Backend ('Postgres pgKind), PostgresAnnotatedFieldJSON pgKind, MonadWriter CustomSQLCTEs m) => AnnAggregateSelect ('Postgres pgKind) -> m Select
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
.