writeStartPart method Null safety

  1. @override
void writeStartPart(
  1. GenerationContext ctx
)
override

Subclasses must override this and write the part of the statement that comes before the where and limit expression..

Implementation

@override
void writeStartPart(GenerationContext ctx) {
  // TODO support the OR (ROLLBACK / ABORT / REPLACE / FAIL / IGNORE...) thing

  ctx.buffer.write('UPDATE ${table.tableWithAlias} SET ');

  var first = true;
  _updatedFields.forEach((columnName, variable) {
    if (!first) {
      ctx.buffer.write(', ');
    } else {
      first = false;
    }

    ctx.buffer
      ..write(escapeIfNeeded(columnName))
      ..write(' = ');

    variable.writeInto(ctx);
  });
}