onRetainNewest method

  1. @override
Future<Set<int>?> onRetainNewest(
  1. int count
)
override

Keeps the count newest entries in store order and returns the removed ids (an empty set if there was nothing to remove) or null if they cannot be determined cheaply: the base then sends LogStoreInvalidated. In SQL, DELETE … RETURNING id provides the ids.

Implementation

@override
Future<Set<int>?> onRetainNewest(int count) async =>
    _entries.length <= count ? const {} : _removeOldest(_entries.length - count);