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

Hasura.Backends.Postgres.Translate.Mutation

Description

Postgres Translate Mutation

Provide a combinator for generating a Postgres SQL SELECT statement for the selected columns in mutation queries.

See Mutation and note [Prepared statements in Mutations]

Synopsis

Documentation

mkSelectExpFromColumnValues :: forall pgKind m. MonadError QErr m => QualifiedTable -> [ColumnInfo ('Postgres pgKind)] -> [ColumnValues ('Postgres pgKind) TxtEncodedVal] -> m Select Source #

Note:- Using sorted columns is necessary to enable casting the rows returned by VALUES expression to table type. For example, let's consider the table, `CREATE TABLE test (id serial primary key, name text not null, age int)`. The generated values expression should be in order of columns; `SELECT ("row"::table).* VALUES (1, Robert, 23) AS "row"`.