arbiter-core-0.1.0.0
arbiter-core
Safe HaskellNone
LanguageGHC2024

Arbiter.Core.Sql.Insert

Description

Internal to the arbiter packages. Not covered by the PVP.

INSERT fragments derived from a profunctor Codec. The column list, the placeholders, and the parameters all come from one value.

Synopsis

Documentation

insertFrag :: Codec s a -> s -> Query ()Source #

A single row: (c1, c2, ...) VALUES (?, ?, ...) with one scalar parameter per column, from cScalar.

batchFrag :: Codec s a -> [s] -> Query ()Source #

A batch source: (c1, ...) SELECT c1, ... FROM (SELECT unnest(?::t1[]) AS c1, ...) src with one array parameter per column, from cArray.

data RowEditSource #

Columns a statement reads from a one-row source aliased edit in place of its own.

Constructors

RowEdit 

Fields

rowEdit :: Codec s a -> s -> RowEditSource #

A codec's written columns as a RowEdit: (SELECT ?::t1 AS c1, ...) edit.

editJoin :: Maybe RowEdit -> Query ()Source #

CROSS JOIN an edit's source, or nothing without an edit.