compileIncrementEach method
Compile an increment each statement.
Implementation
@override
String compileIncrementEach(
Map<String, dynamic> query,
Map<String, int> columns,
Map<String, dynamic> extras,
) {
final table = wrapTable(query['table']);
final wheres = compileWheres(query['wheres'] ?? []);
final updates = <String>[];
columns.forEach((col, amount) {
final wrapped = wrap(col);
final sign = amount >= 0 ? '+' : '-';
updates.add('$wrapped = $wrapped $sign ${amount.abs()}');
});
extras.forEach((col, value) {
updates.add('${wrap(col)} = ?');
});
return 'UPDATE $table SET ${updates.join(', ')} $wheres'.trim();
}