Postgres module

insert_many

procedure · 1 overloadsince 0.27.0Source

Inserts each value in turn (one statement each), stopping at the first error. Returns the rows inserted so far, from context.allocator.

insert_many :: (
    db: $D,
    values: [] $T,
    $call := #caller_code
) -> ([] T, Pg_Error)

Inserts each value in turn (one statement each), stopping at the first error. Returns the rows inserted so far, from context.allocator.

Parameters

db: $D
a connection or pool.
values: [] $T
the rows 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