insertIgnore

open fun <T : Table> T.insertIgnore(body: T.(UpdateBuilder<*>) -> Unit): InsertStatement<Long>

Represents the SQL statement that inserts a new row into a table, while ignoring any possible errors that occur during the process.

For example, if the new row would violate a unique constraint, its insertion would be ignored. Note: INSERT IGNORE is not supported by all vendors. Please check the documentation.

Return

An InsertStatement that can be executed.


open fun <T : Table> T.insertIgnore(selectQuery: AbstractQuery<*>, columns: List<Column<*>>? = null): InsertSelectStatement

Represents the SQL statement that uses data retrieved from a selectQuery to insert new rows into a table, while ignoring any possible errors that occur during the process.

Note: INSERT IGNORE is not supported by all vendors. Please check the documentation.

Return

An InsertSelectStatement that can be executed.

Parameters

selectQuery

Source SELECT query that provides the values to insert.

columns

Columns to insert the values into. This defaults to all columns in the table that are not auto-increment columns without a valid sequence to generate new values.