getConnections API (#5651)

* getConnections

* update

* fix the condition check

* pr feedback

* fix test cases

* add test for the new method

* address comments
This commit is contained in:
Alan Ren
2019-06-19 22:51:53 -07:00
committed by GitHub
parent 47cf496c36
commit b9a0c9ce7e
12 changed files with 201 additions and 9 deletions

10
src/sql/azdata.d.ts vendored
View File

@@ -26,13 +26,21 @@ declare module 'azdata' {
groupId: string;
saveProfile: boolean;
azureTenantId?: string;
options: { [name: string]: any };
static createFrom(options: any[]): ConnectionProfile;
}
/**
* Get the current connection based on the active editor or Object Explorer selection
*/
*/
export function getCurrentConnection(): Thenable<ConnectionProfile>;
/**
* Get known connection profiles including active connections, recent connections and saved connections.
* @param activeConnectionsOnly Indicates whether only get the active connections, default value is false.
* @returns array of connections
*/
export function getConnections(activeConnectionsOnly?: boolean): Thenable<ConnectionProfile[]>;
}
}