delete method

  1. @override
Future<DbResult> delete(
  1. String table, {
  2. required Map<String, dynamic> where,
})
override

Deletes one or more rows from the specified table.

  • where: Conditions to match rows (e.g., {'id': 1}).

Implementation

@override
Future<DbResult> delete(
  String table, {
  required Map<String, dynamic> where,
}) async {
  final conditions = where.keys.map((k) => '$k = ${ph(k)}').join(' AND ');
  return rawQuery(
    'DELETE FROM $table WHERE $conditions RETURNING *;',
    values: where,
  );
}