mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-19 09:35:36 -05:00
Move protocol client out (#643)
* close * connection is working * formatting * adds all * formatting * formatting and changing how features are initialized * formatting * changed named of typings file * update * updated to use dataprotocol npm * formatting * removed unneeded logging * readd npm shrinkwrap * still not working * removed unnecessary codfe * addressed comments * readded azure resource provider * fix capabilities cacheing * added backwards capat for older protocol * update shrinkwrap * update shrinkwrap * updated shrinkwrap * fixed tests * removed dead code * remove dead code * fix compile * remove backcompat stuff * change location of npm * vbump sqltools * merge master * fix imports * fix build breaks * update for sqlops * update yarn dependencies
This commit is contained in:
@@ -20,7 +20,7 @@ import { IInsightsConfig } from 'sql/parts/dashboard/widgets/insights/interfaces
|
||||
import { IInsightsDialogService } from 'sql/parts/insights/common/interfaces';
|
||||
import { ConnectionManagementInfo } from 'sql/parts/connection/common/connectionManagementInfo';
|
||||
import Severity from 'vs/base/common/severity';
|
||||
import data = require('data');
|
||||
import * as sqlops from 'sqlops';
|
||||
import nls = require('vs/nls');
|
||||
import os = require('os');
|
||||
import path = require('path');
|
||||
@@ -134,10 +134,10 @@ export function connectIfNotAlreadyConnected(connectionProfile: IConnectionProfi
|
||||
/**
|
||||
* Select the top rows from an object
|
||||
*/
|
||||
export function scriptSelect(connectionProfile: IConnectionProfile, metadata: data.ObjectMetadata, connectionService: IConnectionManagementService, queryEditorService: IQueryEditorService, scriptingService: IScriptingService): Promise<void> {
|
||||
export function scriptSelect(connectionProfile: IConnectionProfile, metadata: sqlops.ObjectMetadata, connectionService: IConnectionManagementService, queryEditorService: IQueryEditorService, scriptingService: IScriptingService): Promise<void> {
|
||||
return new Promise<void>((resolve, reject) => {
|
||||
connectionService.connectIfNotConnected(connectionProfile).then(connectionResult => {
|
||||
let paramDetails: data.ScriptingParamDetails = getScriptingParamDetails(connectionService, connectionResult, metadata);
|
||||
let paramDetails: sqlops.ScriptingParamDetails = getScriptingParamDetails(connectionService, connectionResult, metadata);
|
||||
scriptingService.script(connectionResult, metadata, ScriptOperation.Select, paramDetails).then(result => {
|
||||
if (result.script) {
|
||||
queryEditorService.newSqlEditor(result.script).then((owner: IConnectableInput) => {
|
||||
@@ -190,7 +190,7 @@ export function editData(connectionProfile: IConnectionProfile, tableName: strin
|
||||
/**
|
||||
* Script the object as a statement based on the provided action (except Select)
|
||||
*/
|
||||
export function script(connectionProfile: IConnectionProfile, metadata: data.ObjectMetadata,
|
||||
export function script(connectionProfile: IConnectionProfile, metadata: sqlops.ObjectMetadata,
|
||||
connectionService: IConnectionManagementService,
|
||||
queryEditorService: IQueryEditorService,
|
||||
scriptingService: IScriptingService,
|
||||
@@ -402,9 +402,9 @@ function getStartPos(script: string, operation: ScriptOperation, typeName: strin
|
||||
}
|
||||
|
||||
|
||||
function getScriptingParamDetails(connectionService: IConnectionManagementService, ownerUri: string, metadata: data.ObjectMetadata): data.ScriptingParamDetails {
|
||||
let serverInfo: data.ServerInfo = getServerInfo(connectionService, ownerUri);
|
||||
let paramDetails: data.ScriptingParamDetails = {
|
||||
function getScriptingParamDetails(connectionService: IConnectionManagementService, ownerUri: string, metadata: sqlops.ObjectMetadata): sqlops.ScriptingParamDetails {
|
||||
let serverInfo: sqlops.ServerInfo = getServerInfo(connectionService, ownerUri);
|
||||
let paramDetails: sqlops.ScriptingParamDetails = {
|
||||
filePath: getFilePath(metadata),
|
||||
scriptCompatibilityOption: scriptCompatibilityOptionMap[serverInfo.serverMajorVersion],
|
||||
targetDatabaseEngineEdition: targetDatabaseEngineEditionMap[serverInfo.engineEditionId],
|
||||
@@ -413,7 +413,7 @@ function getScriptingParamDetails(connectionService: IConnectionManagementServic
|
||||
return paramDetails;
|
||||
}
|
||||
|
||||
function getFilePath(metadata: data.ObjectMetadata): string {
|
||||
function getFilePath(metadata: sqlops.ObjectMetadata): string {
|
||||
let schemaName: string = metadata.schema;
|
||||
let objectName: string = metadata.name;
|
||||
let timestamp = Date.now().toString();
|
||||
@@ -424,7 +424,7 @@ function getFilePath(metadata: data.ObjectMetadata): string {
|
||||
}
|
||||
}
|
||||
|
||||
function getServerInfo(connectionService: IConnectionManagementService, ownerUri: string): data.ServerInfo {
|
||||
function getServerInfo(connectionService: IConnectionManagementService, ownerUri: string): sqlops.ServerInfo {
|
||||
let connection: ConnectionManagementInfo = connectionService.getConnectionInfo(ownerUri);
|
||||
return connection.serverInfo;
|
||||
}
|
||||
Reference in New Issue
Block a user