batchInsert

open fun <T : Table, E> T.batchInsert(ignoreErrors: Boolean = false, shouldReturnGeneratedValues: Boolean = true, body: BatchInsertStatement.(E) -> Unit): BatchInsertStatement

Represents the SQL statement that batch inserts new rows into a table, relying entirely on the underlying driver mechanisms to perform the batching operation.

Return

A BatchInsertStatement that can be executed.

Parameters

ignoreErrors

Whether to ignore errors or not. Note ignoreErrors is not supported by all vendors. Please check the documentation.

shouldReturnGeneratedValues

Specifies whether newly generated values (for example, auto-incremented IDs) should be returned.


open fun <T : Table, E> T.batchInsert(useMultiRowValues: Boolean, ignoreErrors: Boolean = false, shouldReturnGeneratedValues: Boolean = true, body: BatchInsertStatement.(E) -> Unit): BatchInsertStatement

Represents the SQL statement that batch inserts new rows into a table.

Return

A BatchInsertStatement that can be executed.

Parameters

useMultiRowValues

Whether to return a single INSERT statement that uses multi-row values constructor, like INSERT ... VALUES (...), (...), ...; if false, a regular statement will be prepared for driver batching.

ignoreErrors

Whether to ignore errors or not. Note ignoreErrors is not supported by all vendors. Please check the documentation.

shouldReturnGeneratedValues

Specifies whether newly generated values (for example, auto-incremented IDs) should be returned.