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

@@ -5,6 +5,7 @@
'use strict';
import * as azdata from 'azdata';
import * as vscode from 'vscode';
import * as mssql from '../../mssql';
export interface IPackageInfo {
name: string;
@@ -39,12 +40,12 @@ export function getTelemetryErrorType(msg: string): string {
* Return the appropriate endpoint name depending on if the endpoint is a dacpac or a database
* @param endpoint endpoint to get the name of
*/
export function getEndpointName(endpoint: azdata.SchemaCompareEndpointInfo): string {
export function getEndpointName(endpoint: mssql.SchemaCompareEndpointInfo): string {
if (!endpoint) {
return ' ';
}
if (endpoint.endpointType === azdata.SchemaCompareEndpointType.Database) {
if (endpoint.endpointType === mssql.SchemaCompareEndpointType.Database) {
if (!endpoint.serverName && endpoint.connectionDetails) {
endpoint.serverName = endpoint.connectionDetails['serverName'];
}
@@ -72,8 +73,8 @@ function connectionInfoToConnectionProfile(details: azdata.ConnectionInfo): azda
};
}
export async function verifyConnectionAndGetOwnerUri(endpoint: azdata.SchemaCompareEndpointInfo): Promise<string> {
if (endpoint.endpointType === azdata.SchemaCompareEndpointType.Database && endpoint.connectionDetails) {
export async function verifyConnectionAndGetOwnerUri(endpoint: mssql.SchemaCompareEndpointInfo): Promise<string> {
if (endpoint.endpointType === mssql.SchemaCompareEndpointType.Database && endpoint.connectionDetails) {
let connection = await azdata.connection.connect(connectionInfoToConnectionProfile(endpoint.connectionDetails), false, false);
// show error message if the can't connect to the database
@@ -83,4 +84,4 @@ export async function verifyConnectionAndGetOwnerUri(endpoint: azdata.SchemaComp
return await azdata.connection.getUriForConnection(connection.connectionId);
}
return undefined;
}
}