Skip to content

Commit

Permalink
feat: explain query request
Browse files Browse the repository at this point in the history
  • Loading branch information
esseswann authored and zeruk committed Apr 19, 2023
1 parent 315fe96 commit 25354e8
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/table.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ import IType = Ydb.IType;
import DescribeTableResult = Ydb.Table.DescribeTableResult;
import PrepareQueryResult = Ydb.Table.PrepareQueryResult;
import ExecuteQueryResult = Ydb.Table.ExecuteQueryResult;
import ExplainQueryResult = Ydb.Table.ExplainQueryResult
import ITransactionSettings = Ydb.Table.ITransactionSettings;
import BeginTransactionResult = Ydb.Table.BeginTransactionResult;
import ITransactionMeta = Ydb.Table.ITransactionMeta;
Expand Down Expand Up @@ -671,6 +672,17 @@ export class Session extends EventEmitter implements ICreateSessionResult {
});
});
}

public async explainQuery(query: string, operationParams?: Ydb.Operations.IOperationParams): Promise<ExplainQueryResult> {
const request: Ydb.Table.IExplainDataQueryRequest = {
sessionId: this.sessionId,
yqlText: query,
operationParams
};
const response = await this.api.explainDataQuery(request);
const payload = getOperationPayload(this.processResponseMetadata(request, response));
return ExplainQueryResult.decode(payload);
}
}

type SessionCallback<T> = (session: Session) => Promise<T>;
Expand Down

0 comments on commit 25354e8

Please sign in to comment.