From a1a1891c0c45b3825f6984137b871f1d2fb120dd Mon Sep 17 00:00:00 2001 From: Cory Grinstead Date: Mon, 8 Jul 2024 13:07:24 -0500 Subject: [PATCH] fix(nodejs): explain plan (#1434) --- nodejs/lancedb/query.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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); + } } }