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

Hasura.Backends.Postgres.Translate.Select.Internal.Process

Description

This module defines functions that translate from the Postgres IR into Postgres SQL AST.

NOTE: These functions processAnnAggregateSelect, processAnnSimpleSelect, processConnectionSelect, are all mutually recursive.

These functions are generally called from the top level functions in Translate.Select, and the call stack looks like:

  • selectQuerySQL -> mkSQLSelect -> processAnnSimpleSelect -> processSelectParams/processAnnFields
  • selectAggregateQuerySQL -> mkAggregateSelect -> processAnnAggregateSelect -> processSelectParams/processAnnFields
  • connetionSelectQuerySQL -> mkConnectionSelect -> processConnectionSelection -> processSelectParams

SelectSource consists of a prefix, a source, a boolean conditional expression, and info on whether sorting or slicing is done (needed to handle the LIMIT optimisation)

Documentation