diff --git a/nodejs/lancedb/query.ts b/nodejs/lancedb/query.ts index d63e7518..0f8670b7 100644 --- a/nodejs/lancedb/query.ts +++ b/nodejs/lancedb/query.ts @@ -265,7 +265,11 @@ export class QueryBase * @returns A Promise that resolves to a string containing the query execution plan explanation. */ async explainPlan(verbose = false): Promise { - return await this.inner.explainPlan(verbose); + if (this.inner instanceof Promise) { + return this.inner.then((inner) => inner.explainPlan(verbose)); + } else { + return this.inner.explainPlan(verbose); + } } }