range method

Stream<Map<String, Object?>> range({
  1. Object? lower,
  2. bool lowerInclusive = true,
  3. Object? upper,
  4. bool upperInclusive = false,
})

Stream every row whose PK falls in [lower?, upper?).

Implementation

Stream<Map<String, Object?>> range({
  Object? lower,
  bool lowerInclusive = true,
  Object? upper,
  bool upperInclusive = false,
}) async* {
  final lo = lower == null ? null : _encodePrimaryKey(lower);
  final hi = upper == null ? null : _encodePrimaryKey(upper);
  await for (final entry in _index.range(
    lower: lo,
    lowerInclusive: lowerInclusive,
    upper: hi,
    upperInclusive: upperInclusive,
  )) {
    final bytes = await _heap.get(entry.value);
    if (bytes == null) continue;
    yield _decodeRow(bytes);
  }
}