getKeys method

  1. @override
Future<List<String>> getKeys({
  1. int? limit,
  2. int? offset,
})
override

Returns a list of all keys in the cache.

Throws a CacheException if there is an error retrieving the keys. The limit and offset parameters can be used to paginate the results.

Implementation

@override
Future<List<String>> getKeys({int? limit, int? offset}) async {
  final db = await database;
  final result = await db.query(
    'cache',
    columns: ['key'],
    limit: limit,
    offset: offset,
  );
  return result.map((e) => e['key'] as String).toList();
}