From 1b26dc0558bcdd7692ac34050a3e3eed4265d4a9 Mon Sep 17 00:00:00 2001 From: Amir Omidi Date: Wed, 8 Jan 2020 12:08:59 -0800 Subject: [PATCH] Consolidate connection namespace (#8844) --- src/sql/azdata.d.ts | 56 ++++++++++++++++++++++----------------------- 1 file changed, 27 insertions(+), 29 deletions(-) diff --git a/src/sql/azdata.d.ts b/src/sql/azdata.d.ts index fee2c9aab7..27ebcd4f98 100644 --- a/src/sql/azdata.d.ts +++ b/src/sql/azdata.d.ts @@ -146,6 +146,33 @@ declare module 'azdata' { */ connectionId: string; } + + /** + * List the databases that can be accessed from the given connection + * @param connectionId The ID of the connection + * @returns An list of names of databases + */ + export function listDatabases(connectionId: string): Thenable; + + /** + * Get a URI corresponding to the given connection so that it can be used with data + * providers and other APIs that require a connection API. + * Note: If the given connection corresponds to multiple URIs this may return any of them + * @param connectionId The ID of the connection + */ + export function getUriForConnection(connectionId: string): Thenable; + + /** + * Opens the connection dialog, calls the callback with the result. If connection was successful + * returns the connection otherwise returns undefined + */ + export function openConnectionDialog(providers?: string[], initialConnectionProfile?: IConnectionProfile, connectionCompletionOptions?: IConnectionCompletionOptions): Thenable; + + /** + * Opens the connection and add it to object explorer and opens the dashboard and returns the ConnectionResult + * @param connectionProfile connection profile + */ + export function connect(connectionProfile: IConnectionProfile, saveConnection?: boolean, showDashboard?: boolean): Thenable; } /** @@ -4161,35 +4188,6 @@ declare module 'azdata' { errorCode: number; } - export namespace connection { - /** - * List the databases that can be accessed from the given connection - * @param connectionId The ID of the connection - * @returns An list of names of databases - */ - export function listDatabases(connectionId: string): Thenable; - - /** - * Get a URI corresponding to the given connection so that it can be used with data - * providers and other APIs that require a connection API. - * Note: If the given connection corresponds to multiple URIs this may return any of them - * @param connectionId The ID of the connection - */ - export function getUriForConnection(connectionId: string): Thenable; - - /** - * Opens the connection dialog, calls the callback with the result. If connection was successful - * returns the connection otherwise returns undefined - */ - export function openConnectionDialog(providers?: string[], initialConnectionProfile?: IConnectionProfile, connectionCompletionOptions?: IConnectionCompletionOptions): Thenable; - - /** - * Opens the connection and add it to object explorer and opens the dashboard and returns the ConnectionResult - * @param connectionProfile connection profile - */ - export function connect(connectionProfile: IConnectionProfile, saveConnection?: boolean, showDashboard?: boolean): Thenable; - } - export namespace nb { /** * All notebook documents currently known to the system.