read method
- UserId id
Returns the DtoBlocklistRecord stored in the database by the provided
id, if any.
Implementation
Future<DtoBlocklistRecord?> read(UserId id) async {
  final DtoBlocklistRecord? existing = _cache[id];
  if (existing != null) {
    return existing;
  }
  return await safe<DtoBlocklistRecord?>(
    (db) async {
      final stmt = db.select(db.blocklist)
        ..where((u) => u.userId.equals(id.val));
      final BlocklistRow? row = await stmt.getSingleOrNull();
      if (row == null) {
        return null;
      }
      return _BlocklistDb.fromDb(row);
    },
    tag: 'blocklist.read($id)',
    exclusive: false,
  );
}