max method
Implementation
@override
Future<Object?> max(
String table,
String column, {
String? where,
List<Object?>? whereArgs,
}) async {
try {
if (database == null) {
throw const DatabaseBridgeException(
error: 'Database is not initialized',
);
}
final result = await database!.rawQuery(
'SELECT MAX($column) as max FROM $table${where != null ? ' WHERE $where' : ''}',
whereArgs,
);
return result.isNotEmpty ? result.first['max'] : null;
} catch (e) {
throw DatabaseBridgeException(error: e);
}
}