Clean up docs for connect and ConnectionResult (#19509)

* Clean up docs for connect and ConnectionResult

* links

* fix build

* fix
This commit is contained in:
Charles Gagnon
2022-05-25 10:38:00 -07:00
committed by GitHub
parent 6282958bd1
commit 45d7a6dd62
8 changed files with 44 additions and 15 deletions

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

@@ -190,8 +190,10 @@ declare module 'azdata' {
connectionCompletionOptions?: IConnectionCompletionOptions): Thenable<Connection>;
/**
* Opens the connection and add it to object explorer and opens the dashboard and returns the ConnectionResult
* @param connectionProfile connection profile
* Attempts to open a new connection with the options from the given connection profile.
* @param connectionProfile The {@link IConnectionProfile} containing the information for the connection
* @param saveConnection Whether to save the connection in the saved connections list of the Servers view. Default is true
* @param showDashboard Whether to show the dashboard for the connection upon success. Default is true
*/
export function connect(connectionProfile: IConnectionProfile, saveConnection?: boolean, showDashboard?: boolean): Thenable<ConnectionResult>;
@@ -5242,10 +5244,28 @@ declare module 'azdata' {
}
export interface ConnectionResult {
/**
* Whether the connection was successful
*/
connected: boolean;
connectionId: string;
errorMessage: string;
errorCode: number;
/**
* The ID of the connection if it was successful. {@link connection.getUriForConnection} can be used to get
* the URI for this connection used by many of the other Extension API functions.
*/
connectionId?: string | undefined;
/**
* The error message if the connection was unsuccessful
*
* e.g. Login failed for user '<user>'.
*/
errorMessage?: string | undefined;
/**
* The error code number associated with the error if the connection was unsuccessful.
*
* e.g. 18456
* (https://docs.microsoft.com/sql/relational-databases/errors-events/mssqlserver-18456-database-engine-error)
*/
errorCode?: number | undefined;
}
export namespace nb {