in src/models/utils.ts [246:264]
export function isSameProfile(currentProfile: IConnectionProfile, expectedProfile: IConnectionProfile): boolean {
if (currentProfile === undefined) {
return false;
}
if (expectedProfile.profileName) {
// Can match on profile name
return expectedProfile.profileName === currentProfile.profileName;
} else if (currentProfile.profileName) {
// This has a profile name but expected does not - can break early
return false;
} else if (currentProfile.connectionString || expectedProfile.connectionString) {
// If either profile uses connection strings, compare them directly
return currentProfile.connectionString === expectedProfile.connectionString;
}
return expectedProfile.server === currentProfile.server
&& isSameDatabase(expectedProfile.database, currentProfile.database)
&& isSameAuthenticationType(expectedProfile.authenticationType, currentProfile.authenticationType)
&& ((isEmpty(expectedProfile.user) && isEmpty(currentProfile.user)) || expectedProfile.user === currentProfile.user);
}