Add notebook query event listeners before connect (#15136)

This commit is contained in:
Charles Gagnon
2021-04-14 15:09:18 -07:00
committed by GitHub
parent 9066ea153f
commit e7571410e0

View File

@@ -331,8 +331,8 @@ class SqlKernel extends Disposable implements nb.IKernel {
this._queryRunner.runQuery(code).catch(err => onUnexpectedError(err));
} else if (this._currentConnection && this._currentConnectionProfile) {
this._queryRunner = this._instantiationService.createInstance(QueryRunner, this._connectionPath);
this.addQueryEventListeners(this._queryRunner);
this._connectionManagementService.connect(this._currentConnectionProfile, this._connectionPath).then((result) => {
this.addQueryEventListeners(this._queryRunner);
this._queryRunner.runQuery(code).catch(err => onUnexpectedError(err));
}).catch(err => onUnexpectedError(err));
} else {