mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-14 18:46:34 -05:00
More work around isolating node imports (#6512)
* more work around isolating node imports * rewrite query plan input * fix hygiene errors * fix tests * address feedback * remove welcome page changes
This commit is contained in:
@@ -4,7 +4,7 @@
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import { IConnectionManagementService } from 'sql/platform/connection/common/connectionManagement';
|
||||
import * as TaskUtilities from 'sql/workbench/common/taskUtilities';
|
||||
import * as TaskUtilities from 'sql/workbench/browser/taskUtilities';
|
||||
import { IQueryEditorService } from 'sql/workbench/services/queryEditor/common/queryEditorService';
|
||||
import { IConnectionProfile } from 'sql/platform/connection/common/interfaces';
|
||||
import { IScriptingService } from 'sql/platform/scripting/common/scriptingService';
|
||||
@@ -67,162 +67,6 @@ export class NewQueryAction extends Task {
|
||||
}
|
||||
}
|
||||
|
||||
export class ScriptSelectAction extends Action {
|
||||
public static ID = 'selectTop';
|
||||
public static LABEL = nls.localize('scriptSelect', "Select Top 1000");
|
||||
|
||||
constructor(
|
||||
id: string, label: string,
|
||||
@IQueryEditorService protected _queryEditorService: IQueryEditorService,
|
||||
@IConnectionManagementService protected _connectionManagementService: IConnectionManagementService,
|
||||
@IScriptingService protected _scriptingService: IScriptingService
|
||||
) {
|
||||
super(id, label);
|
||||
}
|
||||
|
||||
public run(actionContext: BaseActionContext): Promise<boolean> {
|
||||
return TaskUtilities.scriptSelect(
|
||||
actionContext.profile,
|
||||
actionContext.object,
|
||||
this._connectionManagementService,
|
||||
this._queryEditorService,
|
||||
this._scriptingService
|
||||
).then(() => true);
|
||||
}
|
||||
}
|
||||
|
||||
export class ScriptExecuteAction extends Action {
|
||||
public static ID = 'scriptExecute';
|
||||
public static LABEL = nls.localize('scriptExecute', "Script as Execute");
|
||||
|
||||
constructor(
|
||||
id: string, label: string,
|
||||
@IQueryEditorService protected _queryEditorService: IQueryEditorService,
|
||||
@IConnectionManagementService protected _connectionManagementService: IConnectionManagementService,
|
||||
@IScriptingService protected _scriptingService: IScriptingService,
|
||||
@IErrorMessageService protected _errorMessageService: IErrorMessageService
|
||||
) {
|
||||
super(id, label);
|
||||
}
|
||||
|
||||
public run(actionContext: BaseActionContext): Promise<boolean> {
|
||||
return TaskUtilities.script(
|
||||
actionContext.profile,
|
||||
actionContext.object,
|
||||
this._connectionManagementService,
|
||||
this._queryEditorService,
|
||||
this._scriptingService,
|
||||
TaskUtilities.ScriptOperation.Execute,
|
||||
this._errorMessageService
|
||||
).then(() => true);
|
||||
}
|
||||
}
|
||||
|
||||
export class ScriptAlterAction extends Action {
|
||||
public static ID = 'scriptAlter';
|
||||
public static LABEL = nls.localize('scriptAlter', "Script as Alter");
|
||||
|
||||
constructor(
|
||||
id: string, label: string,
|
||||
@IQueryEditorService protected _queryEditorService: IQueryEditorService,
|
||||
@IConnectionManagementService protected _connectionManagementService: IConnectionManagementService,
|
||||
@IScriptingService protected _scriptingService: IScriptingService,
|
||||
@IErrorMessageService protected _errorMessageService: IErrorMessageService
|
||||
) {
|
||||
super(id, label);
|
||||
}
|
||||
|
||||
public run(actionContext: BaseActionContext): Promise<boolean> {
|
||||
return TaskUtilities.script(
|
||||
actionContext.profile,
|
||||
actionContext.object,
|
||||
this._connectionManagementService,
|
||||
this._queryEditorService,
|
||||
this._scriptingService,
|
||||
TaskUtilities.ScriptOperation.Alter,
|
||||
this._errorMessageService
|
||||
).then(() => true);
|
||||
}
|
||||
}
|
||||
|
||||
export class EditDataAction extends Action {
|
||||
public static ID = 'editData';
|
||||
public static LABEL = nls.localize('editData', "Edit Data");
|
||||
|
||||
constructor(
|
||||
id: string, label: string,
|
||||
@IQueryEditorService protected _queryEditorService: IQueryEditorService,
|
||||
@IConnectionManagementService protected _connectionManagementService: IConnectionManagementService,
|
||||
@IScriptingService protected _scriptingService: IScriptingService
|
||||
) {
|
||||
super(id, label);
|
||||
}
|
||||
|
||||
public run(actionContext: BaseActionContext): Promise<boolean> {
|
||||
return TaskUtilities.scriptEditSelect(
|
||||
actionContext.profile,
|
||||
actionContext.object,
|
||||
this._connectionManagementService,
|
||||
this._queryEditorService,
|
||||
this._scriptingService
|
||||
).then(() => true);
|
||||
}
|
||||
}
|
||||
|
||||
export class ScriptCreateAction extends Action {
|
||||
public static ID = 'scriptCreate';
|
||||
public static LABEL = nls.localize('scriptCreate', "Script as Create");
|
||||
|
||||
constructor(
|
||||
id: string, label: string,
|
||||
@IQueryEditorService protected _queryEditorService: IQueryEditorService,
|
||||
@IConnectionManagementService protected _connectionManagementService: IConnectionManagementService,
|
||||
@IScriptingService protected _scriptingService: IScriptingService,
|
||||
@IErrorMessageService protected _errorMessageService: IErrorMessageService
|
||||
) {
|
||||
super(id, label);
|
||||
}
|
||||
|
||||
public run(actionContext: BaseActionContext): Promise<boolean> {
|
||||
return TaskUtilities.script(
|
||||
actionContext.profile,
|
||||
actionContext.object,
|
||||
this._connectionManagementService,
|
||||
this._queryEditorService,
|
||||
this._scriptingService,
|
||||
TaskUtilities.ScriptOperation.Create,
|
||||
this._errorMessageService
|
||||
).then(() => true);
|
||||
}
|
||||
}
|
||||
|
||||
export class ScriptDeleteAction extends Action {
|
||||
public static ID = 'scriptDelete';
|
||||
public static LABEL = nls.localize('scriptDelete', "Script as Drop");
|
||||
|
||||
constructor(
|
||||
id: string, label: string,
|
||||
@IQueryEditorService protected _queryEditorService: IQueryEditorService,
|
||||
@IConnectionManagementService protected _connectionManagementService: IConnectionManagementService,
|
||||
@IScriptingService protected _scriptingService: IScriptingService,
|
||||
@IErrorMessageService protected _errorMessageService: IErrorMessageService
|
||||
) {
|
||||
super(id, label);
|
||||
}
|
||||
|
||||
public run(actionContext: BaseActionContext): Promise<boolean> {
|
||||
return TaskUtilities.script(
|
||||
actionContext.profile,
|
||||
actionContext.object,
|
||||
this._connectionManagementService,
|
||||
this._queryEditorService,
|
||||
this._scriptingService,
|
||||
TaskUtilities.ScriptOperation.Delete,
|
||||
this._errorMessageService
|
||||
).then(() => true);
|
||||
}
|
||||
}
|
||||
|
||||
export const BackupFeatureName = 'backup';
|
||||
|
||||
export class BackupAction extends Task {
|
||||
|
||||
Reference in New Issue
Block a user