scan method

Future<List<DecodedTuple>> scan({
  1. required bool isVisible(
    1. int xmin,
    2. int xmax
    ),
})

Implementation

Future<List<DecodedTuple>> scan({
  required bool Function(int xmin, int xmax) isVisible,
}) async {
  final result = <DecodedTuple>[];
  for (final pid in await _allPageIds()) {
    final page = await _getPage(pid);
    for (final t in page.scanTuples()) {
      final xmin = TupleCodec.peekXmin(t.data);
      final xmax = TupleCodec.peekXmax(t.data);
      if (isVisible(xmin, xmax)) {
        try {
          final decoded = TupleCodec.decode(schema, t.data);
          result.add(decoded);
        } catch (_) {}
      }
    }
  }
  return result;
}