mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-15 09:35:37 -05:00
Load connection from publish profile (#11263)
* initial changes for reading connection from profile * connection string can now be read from publish.xml * fix build errors and update test * move publish profile tests to their own file * cleanup * update message * fix string * remove apiWrapper
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import * as azdata from 'azdata';
|
||||
import { DataSource } from './dataSources';
|
||||
import * as constants from '../../common/constants';
|
||||
|
||||
@@ -70,6 +71,24 @@ export class SqlConnectionDataSource extends DataSource {
|
||||
public static fromJson(json: DataSourceJson): SqlConnectionDataSource {
|
||||
return new SqlConnectionDataSource(json.name, (json.data as unknown as SqlConnectionDataSourceJson).connectionString);
|
||||
}
|
||||
|
||||
public getConnectionProfile(): azdata.IConnectionProfile {
|
||||
const connProfile: azdata.IConnectionProfile = {
|
||||
serverName: this.server,
|
||||
databaseName: this.database,
|
||||
connectionName: this.name,
|
||||
userName: this.username,
|
||||
password: this.password,
|
||||
authenticationType: this.integratedSecurity ? 'Integrated' : 'SqlAuth',
|
||||
savePassword: false,
|
||||
providerName: 'MSSQL',
|
||||
saveProfile: true,
|
||||
id: this.name + '-dataSource',
|
||||
options: []
|
||||
};
|
||||
|
||||
return connProfile;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user