countRows method

  1. @override
Future<int> countRows(
  1. String table
)
override

Implementation

@override
Future<int> countRows(String table) async {
  try {
    final result = await database!.rawQuery('SELECT COUNT(*) FROM $table');
    return Sqflite.firstIntValue(result) ?? 0;
  } catch (e) {
    throw DatabaseBridgeException(error: e);
  }
}