From 631461494f06ecb2454d6e55902e49aadec4b1aa Mon Sep 17 00:00:00 2001 From: Karl Burtram Date: Wed, 31 May 2023 09:00:30 -0700 Subject: [PATCH] Add getOptionKeyIdNames to IConnectionProfile (#23262) --- .../platform/connection/common/connectionProfile.ts | 1 + src/sql/platform/connection/common/interfaces.ts | 1 + .../connection/test/common/connectionConfig.test.ts | 12 ++++++++++++ .../connection/test/common/connectionProfile.test.ts | 1 + .../connection/test/common/connectionStore.test.ts | 1 + .../test/common/providerConnectionInfo.test.ts | 1 + .../test/node/connectionStatusManager.test.ts | 3 +++ .../test/browser/connectionManagementService.test.ts | 1 + .../test/browser/insightsDialogController.test.ts | 1 + .../test/browser/asyncServerTreeDragAndDrop.test.ts | 1 + .../test/browser/dragAndDropController.test.ts | 2 ++ .../browser/firewallRuleDialogController.test.ts | 1 + 12 files changed, 26 insertions(+) diff --git a/src/sql/platform/connection/common/connectionProfile.ts b/src/sql/platform/connection/common/connectionProfile.ts index 000cecbd77..164bcbb3b8 100644 --- a/src/sql/platform/connection/common/connectionProfile.ts +++ b/src/sql/platform/connection/common/connectionProfile.ts @@ -254,6 +254,7 @@ export class ConnectionProfile extends ProviderConnectionInfo implements interfa databaseName: this.databaseName, authenticationType: this.authenticationType, getOptionsKey: this.getOptionsKey, + getOptionKeyIdNames: this.getOptionKeyIdNames, matches: this.matches, groupId: this.groupId, groupFullName: this.groupFullName, diff --git a/src/sql/platform/connection/common/interfaces.ts b/src/sql/platform/connection/common/interfaces.ts index 9b1786963e..dee0027928 100644 --- a/src/sql/platform/connection/common/interfaces.ts +++ b/src/sql/platform/connection/common/interfaces.ts @@ -10,6 +10,7 @@ export type ProfileMatcher = (a: IConnectionProfile, b: IConnectionProfile) => b export interface IConnectionProfile extends azdata.IConnectionProfile { getOptionsKey(): string; + getOptionKeyIdNames(): string[]; matches(profile: azdata.IConnectionProfile): boolean; } diff --git a/src/sql/platform/connection/test/common/connectionConfig.test.ts b/src/sql/platform/connection/test/common/connectionConfig.test.ts index 0723802171..655c67fb26 100644 --- a/src/sql/platform/connection/test/common/connectionConfig.test.ts +++ b/src/sql/platform/connection/test/common/connectionConfig.test.ts @@ -277,6 +277,7 @@ suite('ConnectionConfig', () => { groupFullName: undefined, groupId: undefined, getOptionsKey: undefined!, + getOptionKeyIdNames: undefined!, matches: undefined!, providerName: 'MSSQL', options: {}, @@ -309,6 +310,7 @@ suite('ConnectionConfig', () => { savePassword: true, groupFullName: undefined, getOptionsKey: undefined!, + getOptionKeyIdNames: undefined!, matches: undefined!, providerName: 'MSSQL', options: {}, @@ -341,6 +343,7 @@ suite('ConnectionConfig', () => { groupFullName: 'g2/g2-2', groupId: undefined, getOptionsKey: undefined!, + getOptionKeyIdNames: undefined!, matches: undefined!, providerName: 'MSSQL', options: {}, @@ -484,6 +487,7 @@ suite('ConnectionConfig', () => { groupFullName: 'g3', groupId: 'g3', getOptionsKey: undefined!, + getOptionKeyIdNames: undefined!, matches: undefined!, providerName: 'MSSQL', options: {}, @@ -514,6 +518,7 @@ suite('ConnectionConfig', () => { groupFullName: 'g3', groupId: 'g3', getOptionsKey: undefined!, + getOptionKeyIdNames: undefined!, matches: undefined!, providerName: 'MSSQL', options: {}, @@ -551,6 +556,7 @@ suite('ConnectionConfig', () => { groupFullName: 'g3', groupId: 'newid', getOptionsKey: undefined!, + getOptionKeyIdNames: undefined!, matches: undefined!, providerName: 'MSSQL', options: {}, @@ -631,6 +637,7 @@ suite('ConnectionConfig', () => { groupFullName: 'g3', groupId: 'g3', getOptionsKey: () => { return 'connectionId'; }, + getOptionKeyIdNames: undefined!, matches: undefined!, providerName: 'MSSQL', options: {}, @@ -648,6 +655,7 @@ suite('ConnectionConfig', () => { groupFullName: 'test', groupId: 'test', getOptionsKey: () => { return 'connectionId'; }, + getOptionKeyIdNames: undefined!, matches: undefined!, providerName: 'MSSQL', options: {}, @@ -688,6 +696,7 @@ suite('ConnectionConfig', () => { groupFullName: 'g3', groupId: 'g3', getOptionsKey: () => { return 'connectionId'; }, + getOptionKeyIdNames: undefined!, matches: undefined!, providerName: 'MSSQL', options: {}, @@ -790,6 +799,7 @@ suite('ConnectionConfig', () => { groupFullName: 'g3', groupId: 'g3', getOptionsKey: () => { return 'connectionId'; }, + getOptionKeyIdNames: undefined!, matches: undefined!, providerName: 'MSSQL', options: {}, @@ -807,6 +817,7 @@ suite('ConnectionConfig', () => { groupFullName: 'test', groupId: 'test', getOptionsKey: () => { return 'connectionId'; }, + getOptionKeyIdNames: undefined!, matches: undefined!, providerName: 'MSSQL', options: {}, @@ -824,6 +835,7 @@ suite('ConnectionConfig', () => { groupFullName: 'test', groupId: 'test', getOptionsKey: () => { return 'connectionId'; }, + getOptionKeyIdNames: undefined!, matches: undefined!, providerName: 'MSSQL', options: {}, diff --git a/src/sql/platform/connection/test/common/connectionProfile.test.ts b/src/sql/platform/connection/test/common/connectionProfile.test.ts index 4797835ed2..c66d3791f2 100644 --- a/src/sql/platform/connection/test/common/connectionProfile.test.ts +++ b/src/sql/platform/connection/test/common/connectionProfile.test.ts @@ -26,6 +26,7 @@ suite('SQL ConnectionProfileInfo tests', () => { groupFullName: 'g2/g2-2', groupId: 'group id', getOptionsKey: undefined!, + getOptionKeyIdNames: undefined!, matches: undefined!, providerName: mssqlProviderName, options: {}, diff --git a/src/sql/platform/connection/test/common/connectionStore.test.ts b/src/sql/platform/connection/test/common/connectionStore.test.ts index cd23b4cdc2..1d4e63a584 100644 --- a/src/sql/platform/connection/test/common/connectionStore.test.ts +++ b/src/sql/platform/connection/test/common/connectionStore.test.ts @@ -32,6 +32,7 @@ suite('ConnectionStore', () => { groupId: '', groupFullName: '', getOptionsKey: undefined!, + getOptionKeyIdNames: undefined!, matches: () => false, providerName: mssqlProviderName, options: {}, diff --git a/src/sql/platform/connection/test/common/providerConnectionInfo.test.ts b/src/sql/platform/connection/test/common/providerConnectionInfo.test.ts index f8b45f9704..5457c8f067 100644 --- a/src/sql/platform/connection/test/common/providerConnectionInfo.test.ts +++ b/src/sql/platform/connection/test/common/providerConnectionInfo.test.ts @@ -25,6 +25,7 @@ suite('SQL ProviderConnectionInfo tests', () => { groupFullName: 'g2/g2-2', groupId: undefined, getOptionsKey: undefined!, + getOptionKeyIdNames: undefined!, matches: undefined!, providerName: mssqlProviderName, options: undefined!, diff --git a/src/sql/platform/connection/test/node/connectionStatusManager.test.ts b/src/sql/platform/connection/test/node/connectionStatusManager.test.ts index 43081a2846..4761d0194a 100644 --- a/src/sql/platform/connection/test/node/connectionStatusManager.test.ts +++ b/src/sql/platform/connection/test/node/connectionStatusManager.test.ts @@ -27,6 +27,7 @@ let connectionProfile: IConnectionProfile = { groupFullName: 'g2/g2-2', groupId: 'group id', getOptionsKey: () => 'connection1', + getOptionKeyIdNames: undefined!, matches: undefined!, providerName: mssqlProviderName, options: {}, @@ -44,6 +45,7 @@ let editorConnectionProfile: IConnectionProfile = { groupFullName: 'g2/g2-2', groupId: 'group id', getOptionsKey: () => 'connection2', + getOptionKeyIdNames: undefined!, matches: undefined!, providerName: mssqlProviderName, options: {}, @@ -61,6 +63,7 @@ let connectionProfileWithoutDbName: IConnectionProfile = { groupFullName: 'g2/g2-2', groupId: 'group id', getOptionsKey: () => 'connection1', + getOptionKeyIdNames: undefined!, matches: undefined!, providerName: mssqlProviderName, options: {}, diff --git a/src/sql/workbench/services/connection/test/browser/connectionManagementService.test.ts b/src/sql/workbench/services/connection/test/browser/connectionManagementService.test.ts index 03d3cebc0d..4ee46e5ae5 100644 --- a/src/sql/workbench/services/connection/test/browser/connectionManagementService.test.ts +++ b/src/sql/workbench/services/connection/test/browser/connectionManagementService.test.ts @@ -68,6 +68,7 @@ suite('SQL ConnectionManagementService tests', () => { groupFullName: 'g2/g2-2', groupId: 'group id', getOptionsKey: () => { return 'connectionId'; }, + getOptionKeyIdNames: undefined!, matches: undefined, providerName: 'MSSQL', options: {}, diff --git a/src/sql/workbench/services/insights/test/browser/insightsDialogController.test.ts b/src/sql/workbench/services/insights/test/browser/insightsDialogController.test.ts index f8294c9df0..155e3dd80d 100644 --- a/src/sql/workbench/services/insights/test/browser/insightsDialogController.test.ts +++ b/src/sql/workbench/services/insights/test/browser/insightsDialogController.test.ts @@ -75,6 +75,7 @@ suite('Insights Dialog Controller Tests', () => { groupFullName: '', groupId: '', getOptionsKey: () => '', + getOptionKeyIdNames: undefined!, matches: undefined, providerName: '', saveProfile: true, diff --git a/src/sql/workbench/services/objectExplorer/test/browser/asyncServerTreeDragAndDrop.test.ts b/src/sql/workbench/services/objectExplorer/test/browser/asyncServerTreeDragAndDrop.test.ts index dd36db9005..9a0a2922d8 100644 --- a/src/sql/workbench/services/objectExplorer/test/browser/asyncServerTreeDragAndDrop.test.ts +++ b/src/sql/workbench/services/objectExplorer/test/browser/asyncServerTreeDragAndDrop.test.ts @@ -36,6 +36,7 @@ suite('AsyncServerTreeDragAndDrop', () => { groupFullName: 'g2/g2-2', groupId: 'group id', getOptionsKey: undefined!, + getOptionKeyIdNames: undefined!, matches: undefined!, providerName: mssqlProviderName, options: {}, diff --git a/src/sql/workbench/services/objectExplorer/test/browser/dragAndDropController.test.ts b/src/sql/workbench/services/objectExplorer/test/browser/dragAndDropController.test.ts index 17bd29a7b3..5ded395055 100644 --- a/src/sql/workbench/services/objectExplorer/test/browser/dragAndDropController.test.ts +++ b/src/sql/workbench/services/objectExplorer/test/browser/dragAndDropController.test.ts @@ -41,6 +41,7 @@ suite('SQL Drag And Drop Controller tests', () => { groupFullName: 'g2/g2-2', groupId: 'group id', getOptionsKey: undefined!, + getOptionKeyIdNames: undefined!, matches: undefined!, providerName: mssqlProviderName, options: {}, @@ -59,6 +60,7 @@ suite('SQL Drag And Drop Controller tests', () => { groupFullName: 'g2/g2-2', groupId: 'group id', getOptionsKey: undefined!, + getOptionKeyIdNames: undefined!, matches: undefined!, providerName: pgsqlProviderName, options: {}, diff --git a/src/sql/workbench/services/resourceProvider/test/browser/firewallRuleDialogController.test.ts b/src/sql/workbench/services/resourceProvider/test/browser/firewallRuleDialogController.test.ts index 64e1e0d8a3..8661211605 100644 --- a/src/sql/workbench/services/resourceProvider/test/browser/firewallRuleDialogController.test.ts +++ b/src/sql/workbench/services/resourceProvider/test/browser/firewallRuleDialogController.test.ts @@ -89,6 +89,7 @@ suite('Firewall rule dialog controller tests', () => { groupFullName: 'g2/g2-2', groupId: 'group id', getOptionsKey: () => '', + getOptionKeyIdNames: undefined!, matches: () => false, providerName: mssqlProviderName, options: {},