addDoUpdate method

void addDoUpdate(
  1. DoUpdate<Object, GeneratedTable<Object, dynamic>> clause
)

Implementation

void addDoUpdate(DoUpdate clause) {
  statement.hasMultipleTables |= clause.usesExcludedTable;
  final table = currentInsertStatement!.table;

  addOnConflictConstraint(
    target: clause.target,
    where: clause.buildTargetCondition(table),
  );
  statement.buffer.write(' DO UPDATE SET ');

  final updateSet = clause.createInsertable(table).toColumns(false);
  addUpdateValues(updateSet);

  if (clause.buildWhereClause(table) case final where?) {
    statement.space();
    where.compileWith(this);
  }
}