mirror of
https://github.com/lancedb/lancedb.git
synced 2026-11-26 20:44:00 +00:00
feat(nodejs): add table delta streams (#5149)
Adds the Embedded `Table.delta` API to the Node.js bindings, matching the Rust/Python contract from #5135. `Table.delta(fromVersion, toVersion?)` accepts a positive safe-integer number, a positive lossless u64 `bigint`, or a same-branch tag string. `TableDelta` exposes `beginVersion`/`endVersion` as `bigint`, streaming `insertedRows()`, `updatedRows()`, `upsertedRows()`, `deletedRowIds()`, and `listTransactions()` with `readVersion` as `bigint`. Readers reuse the existing native Arrow IPC iterator adapter. They are lazy, single-use, serialize pulls, capture/cache the schema before polling, and release the native stream on completion, break, or error. Row readers retain the Rust contract: equal endpoints return empty streams with schemas, invalid/reversed/missing endpoints and cross-branch tags are rejected, and Restore or incomplete transaction history fail closed with full-rescan and range-end checkpoint guidance. Enterprise tables remain unsupported through the native Rust default. The abstract `Table` keeps a concrete unsupported `delta` default for custom subclasses; `LocalTable` overrides it. TypeDoc API docs and focused Node tests cover pinned targets, typed bigint values, transaction listing, lazy rejected readers, schema/decode failures, aliasing, and early drop. Refs OSS-2860
This commit is contained in:
@@ -89,6 +89,7 @@ import {
|
||||
} from '/snippets/tables.mdx';
|
||||
import {
|
||||
PyVersioningCheckpointDelta as VersioningCheckpointDelta,
|
||||
TsVersioningCheckpointDelta as TsVersioningCheckpointDelta,
|
||||
RsVersioningCheckpointDelta as RsVersioningCheckpointDelta,
|
||||
} from '/snippets/table_delta_docs.mdx';
|
||||
import {
|
||||
@@ -1786,10 +1787,11 @@ with stable row IDs enabled, as shown below. If a table does not have them, the
|
||||
row-level readers explain how to recreate it with the option. `list_transactions()`
|
||||
reports the transactions in the range and works without stable row IDs.
|
||||
|
||||
This preview supports Python and Rust for LanceDB Embedded. TypeScript support
|
||||
is a follow-up. The API accepts versions and tags on the current branch only,
|
||||
and rejects tags that belong to another branch. LanceDB Enterprise tables do
|
||||
not support row-level deltas.
|
||||
This preview supports Python, TypeScript, and Rust for LanceDB Embedded. The
|
||||
API accepts versions and tags on the current branch only, and rejects tags that
|
||||
belong to another branch. TypeScript exposes endpoint and transaction
|
||||
`readVersion` values as `bigint`, and reader schemas are available before
|
||||
streaming. LanceDB Enterprise tables do not support row-level deltas.
|
||||
|
||||
A `Restore` can reintroduce rows with older row-version metadata that the delta
|
||||
readers do not report as changed. For that reason, the row-level readers reject
|
||||
@@ -1804,6 +1806,10 @@ range. Branch-vs-main summaries remain a separate `branches.diff()` API.
|
||||
{VersioningCheckpointDelta}
|
||||
</CodeBlock>
|
||||
|
||||
<CodeBlock filename="TypeScript" language="TypeScript" icon="square-js">
|
||||
{TsVersioningCheckpointDelta}
|
||||
</CodeBlock>
|
||||
|
||||
<CodeBlock filename="Rust" language="Rust" icon="rust">
|
||||
{RsVersioningCheckpointDelta}
|
||||
</CodeBlock>
|
||||
|
||||
Reference in New Issue
Block a user