mostVisitedAtSigns method

  1. @override
Future<Map<String, int>> mostVisitedAtSigns(
  1. int length
)
override

Top length atSigns by access-log entry count. Result map: atSign → visit count, ordered by descending count.

Implementation

@override
Future<Map<String, int>> mostVisitedAtSigns(int length) async {
  final rows = _db.raw.select(
      "SELECT from_atsign a, COUNT(*) c FROM access_log WHERE verb_name = 'pol' "
      'AND from_atsign IS NOT NULL GROUP BY from_atsign ORDER BY c DESC LIMIT ?;',
      [length]);
  return {for (final r in rows) r['a'] as String: r['c'] as int};
}