writeStartPart method

  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(ctx.identifier(columnName))
      ..write(' = ');

    variable.writeInto(ctx);
  });
}