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:
Neha Prasad
2026-05-15 04:00:31 +05:30
committed by GitHub
parent 64aeee84a8
commit 13c6dae9a3
4 changed files with 61 additions and 0 deletions

View File

@@ -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();