recalcNextRowId method

Future<void> recalcNextRowId()

Implementation

Future<void> recalcNextRowId() async {
  int maxId = 0;
  for (final pid in await _allPageIds()) {
    final page = await _getPage(pid);
    for (final t in page.scanTuples()) {
      final rid = TupleCodec.peekRowId(t.data);
      if (rid > maxId) maxId = rid;
    }
  }
  _nextRowId = maxId + 1;
}