read method

Future<CacheInfo?> read()

Returns the CacheInfo stored in the database.

Implementation

Future<CacheInfo?> read() async {
  return await safe<CacheInfo?>((db) async {
    final stmt = db.select(db.cacheSummary)..where((u) => u.id.equals(0));
    final CacheSummaryRow? row = await stmt.getSingleOrNull();

    if (row == null) {
      return null;
    }

    return _CacheInfoDb.fromDb(row);
  });
}