Postgres module

insert

procedure · 1 overloadsince 0.27.0Source

Inserts value and returns the row the table now holds (with its defaults and generated columns). Fields with a database default (@pg_default) or a generated value (@pg_generated) are left to the database.

insert :: (db: $D, value: $T, $call := #caller_code) -> (T, Pg_Error)

Inserts value and returns the row the table now holds (with its defaults and generated columns). Fields with a database default (@pg_default) or a generated value (@pg_generated) are left to the database.

Parameters

db: $D
a connection or pool.
value: $T
the row to insert.
$call := #caller_code
the code of the call, which lets the query text be checked while compiling. Leave the default.

Returns

T

See also