mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-28 09:35:38 -05:00
Initial Code Layering (#3788)
* working on formatting * fixed basic lint errors; starting moving things to their appropriate location * formatting * update tslint to match the version of vscode we have * remove unused code * work in progress fixing layering * formatting * moved connection management service to platform * formatting * add missing file * moving more servies * formatting * moving more services * formatting * wip * moving more services * formatting * revert back tslint rules * move css file * add missing svgs
This commit is contained in:
36
src/sql/platform/connection/common/connectionInfo.ts
Normal file
36
src/sql/platform/connection/common/connectionInfo.ts
Normal file
@@ -0,0 +1,36 @@
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
'use strict';
|
||||
|
||||
import Interfaces = require('./interfaces');
|
||||
|
||||
/**
|
||||
* Sets sensible defaults for key connection properties, especially
|
||||
* if connection to Azure
|
||||
*
|
||||
* @export connectionInfo/fixupConnectionCredentials
|
||||
* @param {Interfaces.IConnectionCredentials} connCreds connection to be fixed up
|
||||
* @returns {Interfaces.IConnectionCredentials} the updated connection
|
||||
*/
|
||||
export function fixupConnectionCredentials(connCreds: Interfaces.IConnectionProfile): Interfaces.IConnectionProfile {
|
||||
if (!connCreds.serverName) {
|
||||
connCreds.serverName = '';
|
||||
}
|
||||
|
||||
if (!connCreds.databaseName) {
|
||||
connCreds.databaseName = '';
|
||||
}
|
||||
|
||||
if (!connCreds.userName) {
|
||||
connCreds.userName = '';
|
||||
}
|
||||
|
||||
if (!connCreds.password) {
|
||||
connCreds.password = '';
|
||||
}
|
||||
return connCreds;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user