mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-03-27 23:30:30 -04:00
connection contribution point (#880)
* init * finished compile erros * fixed all merge conflicts * fix dialog problems * formatting * fix opening dialog on first open * fix various problems with connectiondialog * formatting * fix tests * added connection contrib * formatting * formatting and adding capabilities to shutdown * fix connection buffering * formatting * fix tests
This commit is contained in:
@@ -6,7 +6,7 @@
|
||||
'use strict';
|
||||
import * as sqlops from 'sqlops';
|
||||
import { ConnectionManagementInfo } from 'sql/parts/connection/common/connectionManagementInfo';
|
||||
import { ICapabilitiesService, clientCapabilities } from 'sql/services/capabilities/capabilitiesService';
|
||||
import { ICapabilitiesService, clientCapabilities, ProviderFeatures } from 'sql/services/capabilities/capabilitiesService';
|
||||
import { ConnectionOptionSpecialType } from 'sql/workbench/api/common/sqlExtHostTypes';
|
||||
|
||||
import Event, { Emitter } from 'vs/base/common/event';
|
||||
@@ -18,95 +18,94 @@ export class CapabilitiesTestService implements ICapabilitiesService {
|
||||
|
||||
private _providers: sqlops.CapabilitiesProvider[] = [];
|
||||
|
||||
public capabilities: { [id: string]: sqlops.DataProtocolServerCapabilities } = {};
|
||||
public capabilities: { [id: string]: ProviderFeatures } = {};
|
||||
|
||||
constructor() {
|
||||
|
||||
let connectionProvider: sqlops.ConnectionProviderOptions = {
|
||||
options: [
|
||||
{
|
||||
name: 'serverName',
|
||||
displayName: undefined,
|
||||
description: undefined,
|
||||
groupName: undefined,
|
||||
categoryValues: undefined,
|
||||
defaultValue: undefined,
|
||||
isIdentity: true,
|
||||
isRequired: true,
|
||||
specialValueType: ConnectionOptionSpecialType.serverName,
|
||||
valueType: 0
|
||||
},
|
||||
{
|
||||
name: 'databaseName',
|
||||
displayName: undefined,
|
||||
description: undefined,
|
||||
groupName: undefined,
|
||||
categoryValues: undefined,
|
||||
defaultValue: undefined,
|
||||
isIdentity: true,
|
||||
isRequired: true,
|
||||
specialValueType: ConnectionOptionSpecialType.databaseName,
|
||||
valueType: 0
|
||||
},
|
||||
{
|
||||
name: 'userName',
|
||||
displayName: undefined,
|
||||
description: undefined,
|
||||
groupName: undefined,
|
||||
categoryValues: undefined,
|
||||
defaultValue: undefined,
|
||||
isIdentity: true,
|
||||
isRequired: true,
|
||||
specialValueType: ConnectionOptionSpecialType.userName,
|
||||
valueType: 0
|
||||
},
|
||||
{
|
||||
name: 'authenticationType',
|
||||
displayName: undefined,
|
||||
description: undefined,
|
||||
groupName: undefined,
|
||||
categoryValues: undefined,
|
||||
defaultValue: undefined,
|
||||
isIdentity: true,
|
||||
isRequired: true,
|
||||
specialValueType: ConnectionOptionSpecialType.authType,
|
||||
valueType: 0
|
||||
},
|
||||
{
|
||||
name: 'password',
|
||||
displayName: undefined,
|
||||
description: undefined,
|
||||
groupName: undefined,
|
||||
categoryValues: undefined,
|
||||
defaultValue: undefined,
|
||||
isIdentity: true,
|
||||
isRequired: true,
|
||||
specialValueType: ConnectionOptionSpecialType.password,
|
||||
valueType: 0
|
||||
}
|
||||
]
|
||||
};
|
||||
let connectionProvider: sqlops.ConnectionOption[] = [
|
||||
{
|
||||
name: 'serverName',
|
||||
displayName: undefined,
|
||||
description: undefined,
|
||||
groupName: undefined,
|
||||
categoryValues: undefined,
|
||||
defaultValue: undefined,
|
||||
isIdentity: true,
|
||||
isRequired: true,
|
||||
specialValueType: ConnectionOptionSpecialType.serverName,
|
||||
valueType: 0
|
||||
},
|
||||
{
|
||||
name: 'databaseName',
|
||||
displayName: undefined,
|
||||
description: undefined,
|
||||
groupName: undefined,
|
||||
categoryValues: undefined,
|
||||
defaultValue: undefined,
|
||||
isIdentity: true,
|
||||
isRequired: true,
|
||||
specialValueType: ConnectionOptionSpecialType.databaseName,
|
||||
valueType: 0
|
||||
},
|
||||
{
|
||||
name: 'userName',
|
||||
displayName: undefined,
|
||||
description: undefined,
|
||||
groupName: undefined,
|
||||
categoryValues: undefined,
|
||||
defaultValue: undefined,
|
||||
isIdentity: true,
|
||||
isRequired: true,
|
||||
specialValueType: ConnectionOptionSpecialType.userName,
|
||||
valueType: 0
|
||||
},
|
||||
{
|
||||
name: 'authenticationType',
|
||||
displayName: undefined,
|
||||
description: undefined,
|
||||
groupName: undefined,
|
||||
categoryValues: undefined,
|
||||
defaultValue: undefined,
|
||||
isIdentity: true,
|
||||
isRequired: true,
|
||||
specialValueType: ConnectionOptionSpecialType.authType,
|
||||
valueType: 0
|
||||
},
|
||||
{
|
||||
name: 'password',
|
||||
displayName: undefined,
|
||||
description: undefined,
|
||||
groupName: undefined,
|
||||
categoryValues: undefined,
|
||||
defaultValue: undefined,
|
||||
isIdentity: true,
|
||||
isRequired: true,
|
||||
specialValueType: ConnectionOptionSpecialType.password,
|
||||
valueType: 0
|
||||
}
|
||||
];
|
||||
let msSQLCapabilities = {
|
||||
protocolVersion: '1',
|
||||
providerName: 'MSSQL',
|
||||
providerDisplayName: 'MSSQL',
|
||||
connectionProvider: connectionProvider,
|
||||
adminServicesProvider: undefined,
|
||||
features: undefined
|
||||
providerId: 'MSSQL',
|
||||
displayName: 'MSSQL',
|
||||
connectionOptions: connectionProvider,
|
||||
};
|
||||
this.capabilities['MSSQL'] = msSQLCapabilities;
|
||||
this.capabilities['MSSQL'] = { connection: msSQLCapabilities };
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve a list of registered server capabilities
|
||||
*/
|
||||
public getCapabilities(provider: string): sqlops.DataProtocolServerCapabilities {
|
||||
public getCapabilities(provider: string): ProviderFeatures {
|
||||
return this.capabilities[provider];
|
||||
}
|
||||
|
||||
public get providers(): string[] {
|
||||
return Object.keys(this.capabilities);
|
||||
public getLegacyCapabilities(provider: string): sqlops.DataProtocolServerCapabilities {
|
||||
throw new Error("Method not implemented.");
|
||||
}
|
||||
|
||||
public get providers(): { [id: string]: ProviderFeatures } {
|
||||
return this.capabilities;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -129,7 +128,7 @@ export class CapabilitiesTestService implements ICapabilitiesService {
|
||||
return Promise.resolve(null);
|
||||
}
|
||||
|
||||
private _onCapabilitiesRegistered = new Emitter<string>();
|
||||
private _onCapabilitiesRegistered = new Emitter<ProviderFeatures>();
|
||||
public readonly onCapabilitiesRegistered = this._onCapabilitiesRegistered.event;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user