Remove dacfx and schema compare from the azdata api (#6684)

* refactor mssql extension to directly expose dacfx and schema compare

* remove more code

* fix compile errors
This commit is contained in:
Anthony Dresser
2019-08-19 16:34:09 -07:00
committed by GitHub
parent 87b0e08a6a
commit 986ad33678
40 changed files with 1196 additions and 1556 deletions

View File

@@ -7,6 +7,7 @@
import * as should from 'should';
import * as azdata from 'azdata';
import * as mssql from '../../../mssql';
import 'mocha';
import { SchemaCompareDialog } from './../dialogs/schemaCompareDialog';
import { SchemaCompareMainWindow } from '../schemaCompareMainWindow';
@@ -32,8 +33,8 @@ const mockConnectionProfile: azdata.IConnectionProfile = {
const mocksource: string = 'source.dacpac';
const mocktarget: string = 'target.dacpac';
const mockSourceEndpoint: azdata.SchemaCompareEndpointInfo = {
endpointType: azdata.SchemaCompareEndpointType.Dacpac,
const mockSourceEndpoint: mssql.SchemaCompareEndpointInfo = {
endpointType: mssql.SchemaCompareEndpointType.Dacpac,
serverDisplayName: '',
serverName: '',
databaseName: '',
@@ -42,8 +43,8 @@ const mockSourceEndpoint: azdata.SchemaCompareEndpointInfo = {
connectionDetails: undefined
};
const mockTargetEndpoint: azdata.SchemaCompareEndpointInfo = {
endpointType: azdata.SchemaCompareEndpointType.Dacpac,
const mockTargetEndpoint: mssql.SchemaCompareEndpointInfo = {
endpointType: mssql.SchemaCompareEndpointType.Dacpac,
serverDisplayName: '',
serverName: '',
databaseName: '',
@@ -67,7 +68,6 @@ describe('SchemaCompareDialog.openDialog', function (): void {
describe('SchemaCompareResult.start', function (): void {
it('Should be correct when created.', async function (): Promise<void> {
let sc = new SchemaCompareTestService();
azdata.dataprotocol.registerSchemaCompareServicesProvider(sc);
let result = new SchemaCompareMainWindow();
await result.start(null);

View File

@@ -4,8 +4,9 @@
*--------------------------------------------------------------------------------------------*/
import * as azdata from 'azdata';
import * as mssql from '../../../mssql';
export class SchemaCompareTestService implements azdata.SchemaCompareServicesProvider {
export class SchemaCompareTestService implements mssql.ISchemaCompareService {
testOperationId: string = 'Test Operation Id';
@@ -13,8 +14,8 @@ export class SchemaCompareTestService implements azdata.SchemaCompareServicesPro
throw new Error('Method not implemented.');
}
schemaCompareGetDefaultOptions(): Thenable<azdata.SchemaCompareOptionsResult> {
let result: azdata.SchemaCompareOptionsResult = {
schemaCompareGetDefaultOptions(): Thenable<mssql.SchemaCompareOptionsResult> {
let result: mssql.SchemaCompareOptionsResult = {
defaultDeploymentOptions: undefined,
success: true,
errorMessage: ''
@@ -23,21 +24,21 @@ export class SchemaCompareTestService implements azdata.SchemaCompareServicesPro
return Promise.resolve(result);
}
schemaCompareIncludeExcludeNode(operationId: string, diffEntry: azdata.DiffEntry, IncludeRequest: boolean, taskExecutionMode: azdata.TaskExecutionMode): Thenable<azdata.ResultStatus> {
schemaCompareIncludeExcludeNode(operationId: string, diffEntry: mssql.DiffEntry, IncludeRequest: boolean, taskExecutionMode: azdata.TaskExecutionMode): Thenable<azdata.ResultStatus> {
throw new Error('Method not implemented.');
}
schemaCompareOpenScmp(filePath: string): Thenable<azdata.SchemaCompareOpenScmpResult> {
schemaCompareOpenScmp(filePath: string): Thenable<mssql.SchemaCompareOpenScmpResult> {
throw new Error('Method not implemented.');
}
schemaCompareSaveScmp(sourceEndpointInfo: azdata.SchemaCompareEndpointInfo, targetEndpointInfo: azdata.SchemaCompareEndpointInfo, taskExecutionMode: azdata.TaskExecutionMode, deploymentOptions: azdata.DeploymentOptions, scmpFilePath: string, excludedSourceObjects: azdata.SchemaCompareObjectId[], excludedTargetObjects: azdata.SchemaCompareObjectId[]): Thenable<azdata.ResultStatus> {
schemaCompareSaveScmp(sourceEndpointInfo: mssql.SchemaCompareEndpointInfo, targetEndpointInfo: mssql.SchemaCompareEndpointInfo, taskExecutionMode: azdata.TaskExecutionMode, deploymentOptions: mssql.DeploymentOptions, scmpFilePath: string, excludedSourceObjects: mssql.SchemaCompareObjectId[], excludedTargetObjects: mssql.SchemaCompareObjectId[]): Thenable<azdata.ResultStatus> {
throw new Error('Method not implemented.');
}
schemaCompare(operationId: string, sourceEndpointInfo: azdata.SchemaCompareEndpointInfo, targetEndpointInfo: azdata.SchemaCompareEndpointInfo, taskExecutionMode: azdata.TaskExecutionMode): Thenable<azdata.SchemaCompareResult> {
let result: azdata.SchemaCompareResult = {
schemaCompare(operationId: string, sourceEndpointInfo: mssql.SchemaCompareEndpointInfo, targetEndpointInfo: mssql.SchemaCompareEndpointInfo, taskExecutionMode: azdata.TaskExecutionMode): Thenable<mssql.SchemaCompareResult> {
let result: mssql.SchemaCompareResult = {
operationId: this.testOperationId,
areEqual: true,
differences: [],