Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
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
- mkSelectExpFromColumnValues :: forall pgKind m. MonadError QErr m => QualifiedTable -> [ColumnInfo ('Postgres pgKind)] -> [ColumnValues ('Postgres pgKind) TxtEncodedVal] -> m Select
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"`.