count method

  1. @override
Future<int> count({
  1. Database? database,
})
override

Implementation

@override
Future<int> count({Database? database}) async {
  final Database db = database != null ? database : this.database;

  final countResult = await db
      .rawQuery('SELECT COUNT(*) as count FROM ${this.entity.tableName}');

  return countResult[0]['count'] as int;
}