Change hardcoded MSSQL provider name to use constant instead (#5953)

This commit is contained in:
Charles Gagnon
2019-06-10 18:10:39 +00:00
committed by GitHub
parent 97a37e6834
commit 673ecc3870
27 changed files with 118 additions and 102 deletions

View File

@@ -6,6 +6,7 @@
import { IConnectionProfile } from 'sql/platform/connection/common/interfaces';
import { ConnectionProfile } from 'sql/platform/connection/common/connectionProfile';
import { ConnectionProfileGroup } from 'sql/platform/connection/common/connectionProfileGroup';
import { mssqlProviderName } from 'sql/platform/connection/common/constants';
// CONSTANTS //////////////////////////////////////////////////////////////////////////////////////
const msInH = 3.6e6;
@@ -136,6 +137,6 @@ export function findProfileInGroup(og: IConnectionProfile, groups: ConnectionPro
export function isMaster(profile: IConnectionProfile): boolean {
// TODO: the connection profile should have a property to indicate whether the connection is a server connection or database connection
// created issue to track the problem: https://github.com/Microsoft/azuredatastudio/issues/5193.
return (profile.providerName.toLowerCase() === 'mssql' && profile.databaseName.toLowerCase() === 'master')
return (profile.providerName === mssqlProviderName && profile.databaseName.toLowerCase() === 'master')
|| (profile.providerName.toLowerCase() === 'pgsql' && profile.databaseName.toLowerCase() === 'postgres');
}