Some refactoring of sqleditor.js.

This commit is contained in:
Yosry Muhammad
2019-08-23 16:15:43 +01:00
committed by Dave Page
parent 234efc3be7
commit 5887fb3815
5 changed files with 66 additions and 93 deletions

View File

@@ -224,22 +224,22 @@ class ExecuteQuery {
}
if (this.userManagement.isPgaLoginRequired(httpMessage.response)) {
this.sqlServerObject.saveState('execute', [this.explainPlan]);
this.sqlServerObject.saveState('check_data_changes_to_execute_query', [this.explainPlan]);
this.userManagement.pgaLogin();
}
if (httpErrorHandler.httpResponseRequiresNewTransaction(httpMessage.response)) {
this.sqlServerObject.saveState('execute', [this.explainPlan]);
this.sqlServerObject.saveState('check_data_changes_to_execute_query', [this.explainPlan]);
this.sqlServerObject.initTransaction();
}
if (this.wasDatabaseConnectionLost(httpMessage)) {
this.sqlServerObject.saveState('execute', [this.explainPlan]);
this.sqlServerObject.saveState('check_data_changes_to_execute_query', [this.explainPlan]);
this.sqlServerObject.handle_connection_lost(false, httpMessage);
}
if(this.isCryptKeyMissing(httpMessage)) {
this.sqlServerObject.saveState('execute', [this.explainPlan]);
this.sqlServerObject.saveState('check_data_changes_to_execute_query', [this.explainPlan]);
this.sqlServerObject.handle_cryptkey_missing();
return;
}

View File

@@ -39,13 +39,8 @@ let queryToolActions = {
},
executeQuery: function (sqlEditorController) {
if(sqlEditorController.is_query_tool) {
this._clearMessageTab();
sqlEditorController.execute();
} else {
this._clearMessageTab();
sqlEditorController.execute_data_query();
}
this._clearMessageTab();
sqlEditorController.check_data_changes_to_execute_query();
},
explainAnalyze: function (sqlEditorController) {
@@ -60,7 +55,7 @@ let queryToolActions = {
settings: this._settings(),
};
this._clearMessageTab();
sqlEditorController.execute(explainObject);
sqlEditorController.check_data_changes_to_execute_query(explainObject);
},
explain: function (sqlEditorController) {
@@ -76,7 +71,7 @@ let queryToolActions = {
settings: this._settings(),
};
this._clearMessageTab();
sqlEditorController.execute(explainObject);
sqlEditorController.check_data_changes_to_execute_query(explainObject);
},
download: function (sqlEditorController) {