BatchUpsertStatement
Represents the SQL statement that either batch inserts new rows into a table, or updates the existing rows if insertions violate unique constraints.
Parameters
Table to either insert values into or update values from.
(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.
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. This clause may not be supported by all vendors.
Specifies whether newly generated values (for example, auto-incremented IDs) should be returned. See Batch Insert for more details.
Constructors
Properties
The number of rows affected by the insert operation.
The ResultRows generated by processing the database result set retrieved after executing the statement.
The mapping of columns scheduled for change with their new values.
Functions
Returns the list of columns with default values that can not be taken locally. It is the columns defined with defaultExpression()
, databaseGenerated()
Specifies that this column should be updated using the same values that would be inserted if there was no violation of a unique constraint in an upsert statement.
Returns the string representation of an SQL statement.
Calls the specified function onUpdate with an UpdateStatement as its argument, allowing values to be stored as part of the UPDATE clause of the upsert statement associated with this builder.
Updates the mapping of the specified column with the value of the provided expression.