Bring in all the extensibility updates we added during the hackathon (#2056)

Extensibility updates
This commit is contained in:
Amir Ali Omidi
2018-07-26 16:33:32 -07:00
committed by GitHub
parent 87bb2c74d9
commit 4daf3280ff
10 changed files with 70 additions and 10 deletions

View File

@@ -49,6 +49,18 @@ export class MainThreadConnectionManagement implements MainThreadConnectionManag
return Promise.resolve(this._connectionManagementService.getActiveConnectionCredentials(connectionId));
}
public async $listDatabases(connectionId: string): Promise<string[]> {
let connection = this._connectionManagementService.getActiveConnections().find(profile => profile.id === connectionId);
let connectionUri = this._connectionManagementService.getConnectionId(connection);
let result = await this._connectionManagementService.listDatabases(connectionUri);
return result.databaseNames;
}
public $getUriForConnection(connectionId: string): Thenable<string> {
let connection = this._connectionManagementService.getActiveConnections().find(profile => profile.id === connectionId);
return Promise.resolve(this._connectionManagementService.getConnectionId(connection));
}
private convertConnection(profile: IConnectionProfile): sqlops.connection.Connection {
if (!profile) {
return undefined;