delete method

Future<int> delete(
  1. Map<String, dynamic> map,
  2. String table, {
  3. required List<String> keys,
  4. String? dbName,
})

Delete rows matching keys from map. Returns the number of deleted rows.

Implementation

Future<int> delete(Map<String, dynamic> map, String table,
    {required List<String> keys, String? dbName}) async {
  _validateKeys(keys);
  final List<Object?> params = [];
  String whereClause = _getWhereClause(keys, params, map);
  final String sql = "DELETE FROM $table WHERE $whereClause";
  final res =
      await execute(sql, tables: [table], params: params, dbName: dbName);
  return res;
}