destroy method

  1. @override
Future destroy(
  1. dynamic id
)
override

Method destroy deletes entry on database based on id

Implementation

@override
Future<dynamic> destroy(dynamic id) async {
  final builder = SqlBuilder.delete(
    schema.table!,
    where: '${schema.table}.${schema.primaryKey} = ?',
    whereArgs: [id],
  );

  final completer = Completer<dynamic>()
    ..complete(database!.rawDelete(builder.sql, builder.arguments));

  if (isLogger!) Logger.destroy(type, completer.future, builder);

  return await completer.future;
}