batchUpsert
Represents the SQL statement that either batch inserts new rows into a table, or updates the existing rows if insertions violate unique constraints.
Parameters
Collection of values to use in batch upsert.
(optional) Columns to include in the condition that determines a unique constraint match. If no columns are provided, primary keys will be used. If the table does not have any primary keys, the first unique index will be attempted.
Lambda block with an UpdateStatement as its argument, allowing values to be assigned to the UPDATE clause. To specify manually that the insert value should be used when updating a column, for example within an expression or function, invoke insertValue()
with the desired column as the function argument. If left null, all columns will be updated with the values provided for the insert.
List of specific columns to exclude from updating. If left null, all columns will be updated with the values provided for the insert.
Condition that determines which rows to update, if a unique violation is found.
Specifies whether newly generated values (for example, auto-incremented IDs) should be returned. See Batch Insert for more details.
Samples
org.jetbrains.exposed.sql.tests.shared.dml.UpsertTests.testBatchUpsertWithNoConflictRepresents the SQL statement that either batch inserts new rows into a table, or updates the existing rows if insertions violate unique constraints.
Parameters
Sequence of values to use in batch upsert.
(optional) Columns to include in the condition that determines a unique constraint match. If no columns are provided, primary keys will be used. If the table does not have any primary keys, the first unique index will be attempted.
Lambda block with an UpdateStatement as its argument, allowing values to be assigned to the UPDATE clause. To specify manually that the insert value should be used when updating a column, for example within an expression or function, invoke insertValue()
with the desired column as the function argument. If left null, all columns will be updated with the values provided for the insert.
List of specific columns to exclude from updating. If left null, all columns will be updated with the values provided for the insert.
Condition that determines which rows to update, if a unique violation is found.
Specifies whether newly generated values (for example, auto-incremented IDs) should be returned. See Batch Insert for more details.
Samples
org.jetbrains.exposed.sql.tests.shared.dml.UpsertTests.testBatchUpsertWithSequenceDeprecated
This `batchUpsert()` with `onUpdate` parameter that accepts a List will be removed in future releases. Please use `batchUpsert()` with `onUpdate` parameter that takes an `UpdateStatement` lambda block instead.