DoUpdate<T extends Table, D>.withExcluded constructor
DoUpdate<T extends Table, D>.withExcluded (
- Insertable<
D> update(- T old,
- T excluded
- List<
Column> ? target, - Expression<
bool?> where(- T old,
- T excluded
Creates a DO UPDATE
clause.
The update
function will be used to construct an Insertable used to
update an old row that prevented an insert.
It can refer to the values from the old row in the first parameter and
to columns in the row that couldn't be inserted with the excluded
parameter.
The optional where
clause can be used to disable the update based on
the old value. If a where
clause is set and it evaluates to false, a
conflict will keep the old row without applying the update.
For an example, see InsertStatement.insert.
Implementation
DoUpdate.withExcluded(Insertable<D> Function(T old, T excluded) update,
{this.target, Expression<bool?> Function(T old, T excluded)? where})
: _creator = update,
_usesExcludedTable = true,
_where = where == null
? null
: ((old, excluded) => Where(where(old, excluded)));