compileUpdate method

  1. @override
String compileUpdate(
  1. Map<String, dynamic> query,
  2. Map<String, dynamic> values
)
override

Compile an update statement into SQL.

Implementation

@override
String compileUpdate(
  Map<String, dynamic> query,
  Map<String, dynamic> values,
) {
  final table = wrapTable(query['table']);
  final columns = values.keys.map((key) => '${wrap(key)} = ?').join(', ');
  final wheres =
      query['wheres'] != null ? compileWheres(query['wheres']) : '';

  return 'UPDATE $table SET $columns $wheres'.trim();
}