From 1f3a24b594f803b6709ce32e6da6e7b894665348 Mon Sep 17 00:00:00 2001 From: Jack Ye Date: Wed, 23 Sep 2026 21:18:59 -0700 Subject: [PATCH] feat(nodejs): expose dropViewAsync on the public connection The napi binding returned the cleanup job, but `Connection` and `LocalConnection` in `nodejs/lancedb/connection.ts` did not, so a Node caller had no way to reach it: `dropView` waits and resolves to void. Declared on the abstract `Connection` and implemented on `LocalConnection`, wrapping the native handle in the exported `Job` the way `dropMaterializedViewAsync` does. --- nodejs/lancedb/connection.ts | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/nodejs/lancedb/connection.ts b/nodejs/lancedb/connection.ts index 9637d60c2..b525ff5f9 100644 --- a/nodejs/lancedb/connection.ts +++ b/nodejs/lancedb/connection.ts @@ -404,12 +404,25 @@ export abstract class Connection { ): Promise; /** - * Drop the view named `name`. + * Drop the view named `name` and wait for its definition to be deleted. * - * The tables it reads are untouched: a view holds no rows of its own. + * The tables it reads are untouched: a view holds no rows of its own. Use + * {@link dropViewAsync} to retain the cleanup job instead of waiting on it. */ abstract dropView(name: string, namespacePath?: string[]): Promise; + /** + * Start dropping the view named `name` and return the job deleting its + * definition, without waiting for completion. + * + * The name is free before this resolves. When nothing was bound to it, the + * returned job is already finished and has no id. + */ + abstract dropViewAsync( + name: string, + namespacePath?: string[], + ): Promise; + /** * The names of the views in one namespace. * @@ -759,6 +772,10 @@ export class LocalConnection extends Connection { return this.inner.dropView(name, namespacePath ?? []); } + async dropViewAsync(name: string, namespacePath?: string[]): Promise { + return new Job(await this.inner.dropViewAsync(name, namespacePath ?? [])); + } + async listViews(namespacePath?: string[]): Promise { return this.inner.listViews(namespacePath ?? []); }