mirror of
https://github.com/lancedb/lancedb.git
synced 2026-05-21 05:50:41 +00:00
feat(nodejs): add Connection.renameTable with namespace support (#3365)
### Summary - Expose Connection.renameTable in the Node.js bindings and align it with existing namespace-aware connection APIs. ### Changes - Add napi-rs rename_table on Connection, delegating to Rust Connection::rename_table. - Add renameTable(oldName, newName, namespacePath?) on abstract Connection and implement on LocalConnection. - Add a connection test that renames a table and checks names / open behavior. #### Testing - cd nodejs && npm run build - cd nodejs && npm test __test__/connection.test.ts fix : #3364 --------- Co-authored-by: Will Jones <willjones127@gmail.com>
This commit is contained in:
@@ -328,6 +328,20 @@ impl Connection {
|
||||
.default_error()
|
||||
}
|
||||
|
||||
#[napi(catch_unwind)]
|
||||
pub async fn rename_table(
|
||||
&self,
|
||||
old_name: String,
|
||||
new_name: String,
|
||||
namespace_path: Option<Vec<String>>,
|
||||
) -> napi::Result<()> {
|
||||
let ns = namespace_path.unwrap_or_default();
|
||||
self.get_inner()?
|
||||
.rename_table(&old_name, &new_name, &ns, &ns)
|
||||
.await
|
||||
.default_error()
|
||||
}
|
||||
|
||||
#[napi(catch_unwind)]
|
||||
pub async fn drop_all_tables(&self, namespace_path: Option<Vec<String>>) -> napi::Result<()> {
|
||||
let ns = namespace_path.unwrap_or_default();
|
||||
|
||||
Reference in New Issue
Block a user