Postgres module

copy_many

procedure · 1 overloadsince 0.27.0Source

Stores values with one binary COPY and returns how many rows the server stored. Much faster than insert_many for many rows, but it reads nothing back: fields marked @pg_default or @pg_generated are left to the database, as in insert, and their values are not returned.

copy_many :: (db: $D, values: [] $T) -> (s64, Pg_Error)

Stores values with one binary COPY and returns how many rows the server stored. Much faster than insert_many for many rows, but it reads nothing back: fields marked @pg_default or @pg_generated are left to the database, as in insert, and their values are not returned.

Parameters

db: $D
a connection or pool.
values: [] $T
the rows to store.

Returns

s64

See also