mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-18 01:25:37 -05:00
Inital platform relayering (#6385)
* moving test files and inital refactoring * relayer extension host code * fix imports * make insights work * relayer dashboard * relayer notebooks * moveing more code around * formatting * accept angular as browser * fix serializer * add missing files * remove declarations from extensions * fix build errors * more relayering * change urls to relative to help code relayering * remove layering to prep for merge * fix hygiene errors * fix hygiene errors * fix tests
This commit is contained in:
65
src/sql/workbench/api/common/extHostConnectionManagement.ts
Normal file
65
src/sql/workbench/api/common/extHostConnectionManagement.ts
Normal file
@@ -0,0 +1,65 @@
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import { ExtHostConnectionManagementShape, SqlMainContext, MainThreadConnectionManagementShape } from 'sql/workbench/api/common/sqlExtHost.protocol';
|
||||
import { IMainContext } from 'vs/workbench/api/common/extHost.protocol';
|
||||
import * as azdata from 'azdata';
|
||||
|
||||
export class ExtHostConnectionManagement extends ExtHostConnectionManagementShape {
|
||||
|
||||
private _proxy: MainThreadConnectionManagementShape;
|
||||
|
||||
constructor(
|
||||
mainContext: IMainContext
|
||||
) {
|
||||
super();
|
||||
this._proxy = mainContext.getProxy(SqlMainContext.MainThreadConnectionManagement);
|
||||
}
|
||||
|
||||
public $getCurrentConnection(): Thenable<azdata.connection.ConnectionProfile> {
|
||||
return this._proxy.$getCurrentConnectionProfile();
|
||||
}
|
||||
|
||||
public $getConnections(activeConnectionsOnly?: boolean): Thenable<azdata.connection.ConnectionProfile[]> {
|
||||
return this._proxy.$getConnections(activeConnectionsOnly);
|
||||
}
|
||||
|
||||
// "sqlops" back-compat connection APIs
|
||||
public $getActiveConnections(): Thenable<azdata.connection.Connection[]> {
|
||||
return this._proxy.$getActiveConnections();
|
||||
}
|
||||
|
||||
public $getSqlOpsCurrentConnection(): Thenable<azdata.connection.Connection> {
|
||||
return this._proxy.$getCurrentConnection();
|
||||
}
|
||||
|
||||
public $getCredentials(connectionId: string): Thenable<{ [name: string]: string }> {
|
||||
return this._proxy.$getCredentials(connectionId);
|
||||
}
|
||||
|
||||
public $getServerInfo(connectionId: string): Thenable<azdata.ServerInfo> {
|
||||
return this._proxy.$getServerInfo(connectionId);
|
||||
}
|
||||
|
||||
public $openConnectionDialog(providers?: string[], initialConnectionProfile?: azdata.IConnectionProfile, connectionCompletionOptions?: azdata.IConnectionCompletionOptions): Thenable<azdata.connection.Connection> {
|
||||
return this._proxy.$openConnectionDialog(providers, initialConnectionProfile, connectionCompletionOptions);
|
||||
}
|
||||
|
||||
public $listDatabases(connectionId: string): Thenable<string[]> {
|
||||
return this._proxy.$listDatabases(connectionId);
|
||||
}
|
||||
|
||||
public $getConnectionString(connectionId: string, includePassword: boolean): Thenable<string> {
|
||||
return this._proxy.$getConnectionString(connectionId, includePassword);
|
||||
}
|
||||
|
||||
public $getUriForConnection(connectionId: string): Thenable<string> {
|
||||
return this._proxy.$getUriForConnection(connectionId);
|
||||
}
|
||||
|
||||
public $connect(connectionProfile: azdata.IConnectionProfile, saveConnection: boolean = true, showDashboard: boolean = true): Thenable<azdata.ConnectionResult> {
|
||||
return this._proxy.$connect(connectionProfile, saveConnection, showDashboard);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user