Connection URI with complete options (finalized) (#22735)

* Connection URI made to include every option available instead of basic details (#22045)

* Revert "Merge remote-tracking branch 'origin' into feat/connectionUri"

This reverts commit 11b2d31bf99e216daee823f732254f69a017fee1, reversing
changes made to 36e4db8c0744f81565efdfd2f56a3ae3c0026896.

* Revert "Revert "Merge remote-tracking branch 'origin' into feat/connectionUri""

This reverts commit f439673c2693e1144c52e04c14e82cd8566c13a6.

* Added changes and fixes for feat connectionuri (#22706)

* add title generation at start

* added await to refreshConnectionTreeTitles
This commit is contained in:
Alex Ma
2023-04-18 11:08:48 -07:00
committed by GitHub
parent a9bc34acf0
commit b69e87df15
27 changed files with 1641 additions and 86 deletions

View File

@@ -26,11 +26,18 @@ export function registerTableDesignerCommands(appContext: AppContext) {
if (!connectionString) {
throw new Error(FailedToGetConnectionStringError);
}
let titleString = `${context.connectionProfile!.serverName} - ${context.connectionProfile!.databaseName} - ${NewTableText}`;
// append non default options to end to let users know exact connection.
let nonDefaultOptions = await azdata.connection.getEditorConnectionProfileTitle(context.connectionProfile, true);
nonDefaultOptions = nonDefaultOptions.replace('(', '[').replace(')', ']');
if (nonDefaultOptions !== '') {
titleString += `${nonDefaultOptions}`;
}
const tableIcon = context.nodeInfo!.nodeSubType as azdata.designers.TableIcon;
const telemetryInfo = await getTelemetryInfo(context, tableIcon);
await azdata.designers.openTableDesigner(sqlProviderName, {
title: NewTableText,
tooltip: `${context.connectionProfile!.serverName} - ${context.connectionProfile!.databaseName} - ${NewTableText}`,
tooltip: titleString,
server: context.connectionProfile!.serverName,
database: context.connectionProfile!.databaseName,
isNewTable: true,
@@ -56,11 +63,18 @@ export function registerTableDesignerCommands(appContext: AppContext) {
if (!connectionString) {
throw new Error(FailedToGetConnectionStringError);
}
let titleString = `${server} - ${database} - ${schema}.${name}`;
// append non default options to end to let users know exact connection.
let nonDefaultOptions = await azdata.connection.getEditorConnectionProfileTitle(context.connectionProfile, true);
nonDefaultOptions = nonDefaultOptions.replace('(', '[').replace(')', ']');
if (nonDefaultOptions !== '') {
titleString += `${nonDefaultOptions}`;
}
const tableIcon = context.nodeInfo!.nodeSubType as azdata.designers.TableIcon;
const telemetryInfo = await getTelemetryInfo(context, tableIcon);
await azdata.designers.openTableDesigner(sqlProviderName, {
title: `${schema}.${name}`,
tooltip: `${server} - ${database} - ${schema}.${name}`,
tooltip: titleString,
server: server,
database: database,
isNewTable: false,