feat(node): add allowExternalBlobOutsideBases to Table.add for parity with Python and Rust
Python's Table.add and Rust's add builder accept allow_external_blob_outside_bases, added in #3954. The TypeScript AddDataOptions has no equivalent, so a TS caller can't store a blob as an absolute external URI:
Invalid input, External blob URI 'file:///.../payload.bin' is outside registered external bases (dataset root is not allowed). Set allow_external_blob_outside_bases=true to store it as absolute external URI.The error tells the user to set an option that doesn't exist in this SDK.
No SDK can register an external base yet (add_bases is a follow-up from #3954), and the dataset root never counts as one. So for a TS user on a local table, this flag is currently the only way to write a URI blob at all.
Repro
@lancedb/[email protected], local table:
import * as lancedb from "@lancedb/lancedb";
import { Field, Int64, Schema } from "apache-arrow";
const db = await lancedb.connect("./data");
const table = await db.createEmptyTable(
"blobs",
new Schema([new Field("id", new Int64()), lancedb.blob("payload")]),
);
await table.add([{ id: 1n, payload: "file:///tmp/payload.bin" }]); // throwsProposed
Add allowExternalBlobOutsideBases?: boolean to AddDataOptions and pass it through to the Rust AddDataBuilder, with the same semantics as Python: local tables only, stores the absolute URI, doesn't register a base.
Remote tables reject this flag in the Rust client. Supporting URI blobs on remote is a larger piece of work tracked separately and is out of scope here.
Source: lancedb/lancedb