fix(nodejs): explain plan (#1434)

This commit is contained in:
Cory Grinstead
2024-07-08 13:07:24 -05:00
committed by GitHub
parent 3c6c21c137
commit a1a1891c0c

View File

@@ -265,7 +265,11 @@ export class QueryBase<NativeQueryType extends NativeQuery | NativeVectorQuery>
* @returns A Promise that resolves to a string containing the query execution plan explanation.
*/
async explainPlan(verbose = false): Promise<string> {
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);
}
}
}