mirror of
https://github.com/lancedb/lancedb.git
synced 2026-11-26 12:33:59 +00:00
feat(nodejs): add Enterprise table override APIs (#5077)
Add TypeScript `getTableOverrides`, `updateTableOverrides`, and `resetTableOverrides` for LanceDB Enterprise tables, delegating to the shared Rust implementation used by Python. Document that updates perform GET → recursive local merge → full PUT. Unrelated fields are preserved from the read snapshot, but concurrent edits can be overwritten. CLI `set` and REST PUT retain replacement semantics. Fix an empty SDK update to return the current snapshot without a PUT. Live testing found that the previous implementation submitted an empty replacement and failed when no overrides were configured. The fix applies to Python, Rust, and TypeScript. Add mock HTTP/local coverage and an opt-in Enterprise integration suite for namespaces, branch isolation, REST replacement, validation failures, historical handles, and empty updates.
This commit is contained in:
@@ -821,6 +821,37 @@ impl Table {
|
||||
Ok(spec.map(RTEWriteSpec::from))
|
||||
}
|
||||
|
||||
#[napi(catch_unwind, ts_return_type = "Promise<Record<string, unknown>>")]
|
||||
pub async fn get_table_overrides(&self) -> napi::Result<serde_json::Value> {
|
||||
self.inner_ref()?
|
||||
.get_table_overrides()
|
||||
.await
|
||||
.default_error()
|
||||
}
|
||||
|
||||
#[napi(
|
||||
catch_unwind,
|
||||
ts_args_type = "overrides: Record<string, unknown>",
|
||||
ts_return_type = "Promise<Record<string, unknown>>"
|
||||
)]
|
||||
pub async fn update_table_overrides(
|
||||
&self,
|
||||
overrides: serde_json::Value,
|
||||
) -> napi::Result<serde_json::Value> {
|
||||
self.inner_ref()?
|
||||
.update_table_overrides(overrides)
|
||||
.await
|
||||
.default_error()
|
||||
}
|
||||
|
||||
#[napi(catch_unwind, ts_return_type = "Promise<Record<string, unknown>>")]
|
||||
pub async fn reset_table_overrides(&self) -> napi::Result<serde_json::Value> {
|
||||
self.inner_ref()?
|
||||
.reset_table_overrides()
|
||||
.await
|
||||
.default_error()
|
||||
}
|
||||
|
||||
#[napi(catch_unwind, js_name = "closeRTEWriters")]
|
||||
pub async fn close_rte_writers(&self) -> napi::Result<()> {
|
||||
self.inner_ref()?.close_rte_writers().await.default_error()
|
||||
|
||||
Reference in New Issue
Block a user