@@ -47,6 +47,7 @@ import ExecuteScanQueryPartialResult = Ydb.Table.ExecuteScanQueryPartialResult;
4747import IKeyRange = Ydb . Table . IKeyRange ;
4848import TypedValue = Ydb . TypedValue ;
4949import BulkUpsertResult = Ydb . Table . BulkUpsertResult ;
50+ import OperationMode = Ydb . Operations . OperationParams . OperationMode ;
5051
5152interface PartialResponse < T > {
5253 status ?: ( Ydb . StatusIds . StatusCode | null ) ;
@@ -100,19 +101,19 @@ interface IQueryParams {
100101}
101102
102103export class OperationParams implements Ydb . Operations . IOperationParams {
103- operationMode ?: Ydb . Operations . OperationParams . OperationMode ;
104+ operationMode ?: OperationMode ;
104105 operationTimeout ?: google . protobuf . IDuration ;
105106 cancelAfter ?: google . protobuf . IDuration ;
106107 labels ?: { [ k : string ] : string } ;
107108 reportCostInfo ?: Ydb . FeatureFlag . Status ;
108109
109110 withSyncMode ( ) {
110- this . operationMode = Ydb . Operations . OperationParams . OperationMode . SYNC ;
111+ this . operationMode = OperationMode . SYNC ;
111112 return this ;
112113 }
113114
114115 withAsyncMode ( ) {
115- this . operationMode = Ydb . Operations . OperationParams . OperationMode . ASYNC ;
116+ this . operationMode = OperationMode . ASYNC ;
116117 return this ;
117118 }
118119
@@ -377,7 +378,11 @@ export class Session extends EventEmitter implements ICreateSessionResult {
377378
378379 @retryable ( )
379380 @pessimizable
380- public async alterTable ( tablePath : string , description : AlterTableDescription , settings ?: AlterTableSettings ) : Promise < void > {
381+ public async alterTable (
382+ tablePath : string ,
383+ description : AlterTableDescription ,
384+ settings ?: AlterTableSettings
385+ ) : Promise < void > {
381386 const request : Ydb . Table . IAlterTableRequest = {
382387 ...description ,
383388 sessionId : this . sessionId ,
@@ -386,8 +391,15 @@ export class Session extends EventEmitter implements ICreateSessionResult {
386391 if ( settings ) {
387392 request . operationParams = settings . operationParams ;
388393 }
394+
395+ // !! does not returns response if async operation mode
389396 const response = await this . api . alterTable ( request ) ;
390- ensureOperationSucceeded ( this . processResponseMetadata ( request , response ) ) ;
397+ try {
398+ ensureOperationSucceeded ( this . processResponseMetadata ( request , response ) ) ;
399+ } catch ( error ) {
400+ if ( request . operationParams ?. operationMode !== OperationMode . SYNC && error instanceof MissingStatus ) {
401+ } else throw error ;
402+ }
391403 }
392404
393405 /*
0 commit comments