deleteObjet<T> method

Future<bool> deleteObjet<T>([
  1. String? afterWhere,
  2. List<Object?>? whereArgs
])

Deletes rows of T matching afterWhere (? placeholders take their values from whereArgs). When afterWhere is null every row of the table is removed (the table itself is preserved).

Throws DatabaseException if the entity table does not exist.

Implementation

Future<bool> deleteObjet<T>([
  String? afterWhere,
  List<Object?>? whereArgs,
]) async {
  final int affected = await (await _executor()).change(
    'DELETE FROM ${quoteIdentifier(_tableFor<T>())}${whereClause(afterWhere)}',
    toSqlValues(whereArgs),
  );
  return affected > 0;
}