mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 10:58:30 -05:00
Feature/schemacompare options (#5143)
* extension now working * make button messages better * fix diff editor title disappearing and remove border from source and target name boxes * redoing a bunch of stuff that disappeared after rebasing * add images and add to extensions.ts * moving a few changes to the right place after rebase * formatting * Initial schema compare options working code * Adding description.icon etc. * Enabling disabling options button * Name change: SchemaCompareOptions to DeploymentOptions. To reflect SqltoolsService side parameters * Adding sorting and correct sql tools version * Adding options button themes * Formatting fix * Adding get default options call to get options from tools service * Exclude/Include changes - first commit * Adding border to checkboxes * Taking PR comments * Updating to latest sqltools with schema compare options
This commit is contained in:
@@ -439,6 +439,7 @@ export interface SchemaCompareParams {
|
||||
sourceEndpointInfo: azdata.SchemaCompareEndpointInfo;
|
||||
targetEndpointInfo: azdata.SchemaCompareEndpointInfo;
|
||||
taskExecutionMode: TaskExecutionMode;
|
||||
deploymentOptions: azdata.DeploymentOptions;
|
||||
}
|
||||
|
||||
export interface SchemaCompareGenerateScriptParams {
|
||||
@@ -455,6 +456,17 @@ export interface SchemaComparePublishChangesParams {
|
||||
taskExecutionMode: TaskExecutionMode;
|
||||
}
|
||||
|
||||
export interface SchemaCompareGetOptionsParams {
|
||||
|
||||
}
|
||||
|
||||
export interface SchemaCompareNodeParams {
|
||||
operationId: string;
|
||||
diffEntry: azdata.DiffEntry;
|
||||
includeRequest: boolean;
|
||||
taskExecutionMode: TaskExecutionMode;
|
||||
}
|
||||
|
||||
export namespace SchemaCompareRequest {
|
||||
export const type = new RequestType<SchemaCompareParams, azdata.SchemaCompareResult, void, void>('schemaCompare/compare');
|
||||
}
|
||||
@@ -466,4 +478,13 @@ export namespace SchemaCompareGenerateScriptRequest {
|
||||
export namespace SchemaComparePublishChangesRequest {
|
||||
export const type = new RequestType<SchemaComparePublishChangesParams, azdata.ResultStatus, void, void>('schemaCompare/publish');
|
||||
}
|
||||
|
||||
export namespace SchemaCompareGetDefaultOptionsRequest {
|
||||
export const type = new RequestType<SchemaCompareGetOptionsParams, azdata.SchemaCompareOptionsResult, void, void>('schemaCompare/getDefaultOptions');
|
||||
}
|
||||
|
||||
export namespace SchemaCompareIncludeExcludeNodeRequest {
|
||||
export const type = new RequestType<SchemaCompareNodeParams, azdata.ResultStatus, void, void>('schemaCompare/includeExcludeNode');
|
||||
}
|
||||
|
||||
// ------------------------------- <Schema Compare> -----------------------------
|
||||
|
||||
@@ -145,7 +145,9 @@ export class DacFxServicesFeature extends SqlOpsFeature<undefined> {
|
||||
export class SchemaCompareServicesFeature extends SqlOpsFeature<undefined> {
|
||||
private static readonly messageTypes: RPCMessageType[] = [
|
||||
contracts.SchemaCompareRequest.type,
|
||||
contracts.SchemaCompareGenerateScriptRequest.type
|
||||
contracts.SchemaCompareGenerateScriptRequest.type,
|
||||
contracts.SchemaCompareGetDefaultOptionsRequest.type,
|
||||
contracts.SchemaCompareIncludeExcludeNodeRequest.type
|
||||
];
|
||||
|
||||
constructor(client: SqlOpsDataClient) {
|
||||
@@ -165,8 +167,8 @@ export class SchemaCompareServicesFeature extends SqlOpsFeature<undefined> {
|
||||
protected registerProvider(options: undefined): Disposable {
|
||||
const client = this._client;
|
||||
|
||||
let schemaCompare = (sourceEndpointInfo: azdata.SchemaCompareEndpointInfo, targetEndpointInfo: azdata.SchemaCompareEndpointInfo, taskExecutionMode: azdata.TaskExecutionMode): Thenable<azdata.SchemaCompareResult> => {
|
||||
let params: contracts.SchemaCompareParams = { sourceEndpointInfo: sourceEndpointInfo, targetEndpointInfo: targetEndpointInfo, taskExecutionMode: taskExecutionMode };
|
||||
let schemaCompare = (sourceEndpointInfo: azdata.SchemaCompareEndpointInfo, targetEndpointInfo: azdata.SchemaCompareEndpointInfo, taskExecutionMode: azdata.TaskExecutionMode, deploymentOptions: azdata.DeploymentOptions): Thenable<azdata.SchemaCompareResult> => {
|
||||
let params: contracts.SchemaCompareParams = { sourceEndpointInfo: sourceEndpointInfo, targetEndpointInfo: targetEndpointInfo, taskExecutionMode: taskExecutionMode, deploymentOptions: deploymentOptions };
|
||||
return client.sendRequest(contracts.SchemaCompareRequest.type, params).then(
|
||||
r => {
|
||||
return r;
|
||||
@@ -204,11 +206,39 @@ export class SchemaCompareServicesFeature extends SqlOpsFeature<undefined> {
|
||||
);
|
||||
};
|
||||
|
||||
let schemaCompareGetDefaultOptions = (): Thenable<azdata.SchemaCompareOptionsResult> => {
|
||||
let params: contracts.SchemaCompareGetOptionsParams = {};
|
||||
return client.sendRequest(contracts.SchemaCompareGetDefaultOptionsRequest.type, params).then(
|
||||
r => {
|
||||
return r;
|
||||
},
|
||||
e => {
|
||||
client.logFailedRequest(contracts.SchemaCompareGetDefaultOptionsRequest.type, e);
|
||||
return Promise.resolve(undefined);
|
||||
}
|
||||
);
|
||||
};
|
||||
|
||||
let schemaCompareIncludeExcludeNode = (operationId: string, diffEntry: azdata.DiffEntry, includeRequest: boolean, taskExecutionMode: azdata.TaskExecutionMode): Thenable<azdata.DacFxResult> => {
|
||||
let params: contracts.SchemaCompareNodeParams = { operationId: operationId, diffEntry, includeRequest, taskExecutionMode: taskExecutionMode };
|
||||
return client.sendRequest(contracts.SchemaCompareIncludeExcludeNodeRequest.type, params).then(
|
||||
r => {
|
||||
return r;
|
||||
},
|
||||
e => {
|
||||
client.logFailedRequest(contracts.SchemaCompareIncludeExcludeNodeRequest.type, e);
|
||||
return Promise.resolve(undefined);
|
||||
}
|
||||
);
|
||||
};
|
||||
|
||||
return azdata.dataprotocol.registerSchemaCompareServicesProvider({
|
||||
providerId: client.providerId,
|
||||
schemaCompare,
|
||||
schemaCompareGenerateScript,
|
||||
schemaComparePublishChanges
|
||||
schemaComparePublishChanges,
|
||||
schemaCompareGetDefaultOptions,
|
||||
schemaCompareIncludeExcludeNode
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user