#4300·lancedb

feat(node): expose seek, tell, bounded read, readRanges and close on BlobFile

Author: wjones127Created Sep 23, 2026Updated Sep 23, 2026
Labelsenhancementtypescript

The TypeScript BlobFile exposes only size(), read() and readRange(). The Rust BlobFile that backs it also has seek, tell, read_up_to, read_ranges and close, and Python's BlobFile is a seekable file object (seek, tell, read(size), readinto).

What's missing in TS:

  • Seeking. After read() the cursor is at the end, and there's no way to move it back. Cursor-based reading is effectively one-shot; everything else has to use readRange.
  • Bounded sequential reads. There's no read(n)/readUpTo, so streaming a large blob in chunks means tracking offsets yourself with readRange.
  • readRanges. Reading several ranges takes separate calls. Rust's read_ranges issues them concurrently with a bound and preserves order.
  • close(). Handles can't be released explicitly; on remote tables a handle holds a request context until it's collected.

Proposed

Expose the existing Rust methods on the Node binding: seek(pos), tell(), read(maxBytes?) (backed by read_up_to), readRanges(ranges) and close(). Longer term, a ReadableStream/async iterator over a handle would let users pipe blobs directly (e.g. to an HTTP response).

@lancedb/[email protected].