records method
- int? limit,
Returns the recent DtoBlocklistRecords being in a historical view order.
Implementation
Future<List<DtoBlocklistRecord>> records({int? limit}) async {
final result = await safe(
(db) async {
final stmt = db.select(db.blocklist);
stmt.orderBy([(u) => OrderingTerm.desc(u.at)]);
if (limit != null) {
stmt.limit(limit);
}
return (await stmt.get()).map(_BlocklistDb.fromDb).toList();
},
tag: 'blocklist.records(limit: $limit)',
exclusive: false,
);
return result ?? [];
}