mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-16 09:35:36 -05:00
Database projects deploy (#10417)
* Hooking up deployment of SQL projects to the project build functionality and database selection UI * Adding ADS-side plumbing for sqlcmdvars
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
export interface IDeploymentProfile {
|
||||
databaseName: string;
|
||||
connectionUri: string;
|
||||
upgradeExisting: boolean;
|
||||
sqlCmdVariables?: Record<string, string>;
|
||||
}
|
||||
|
||||
export interface IGenerateScriptProfile {
|
||||
databaseName: string;
|
||||
connectionUri: string;
|
||||
sqlCmdVariables?: Record<string, string>;
|
||||
}
|
||||
@@ -25,6 +25,27 @@ export class SqlConnectionDataSource extends DataSource {
|
||||
return constants.sqlConnectionStringFriendly;
|
||||
}
|
||||
|
||||
public get server(): string {
|
||||
return this.getSetting(constants.dataSourceSetting);
|
||||
}
|
||||
|
||||
public get database(): string {
|
||||
return this.getSetting(constants.initialCatalogSetting);
|
||||
}
|
||||
|
||||
public get integratedSecurity(): boolean {
|
||||
return this.getSetting(constants.integratedSecuritySetting).toLowerCase() === 'true';
|
||||
}
|
||||
|
||||
public get username(): string {
|
||||
return this.getSetting(constants.userIdSetting);
|
||||
}
|
||||
|
||||
public get password(): string {
|
||||
// TODO: secure password storage; https://github.com/microsoft/azuredatastudio/issues/10561
|
||||
return this.getSetting(constants.passwordSetting);
|
||||
}
|
||||
|
||||
constructor(name: string, connectionString: string) {
|
||||
super(name);
|
||||
|
||||
@@ -38,12 +59,12 @@ export class SqlConnectionDataSource extends DataSource {
|
||||
throw new Error(constants.invalidSqlConnectionString);
|
||||
}
|
||||
|
||||
this.connectionStringComponents[split[0]] = split[1];
|
||||
this.connectionStringComponents[split[0].toLocaleLowerCase()] = split[1];
|
||||
}
|
||||
}
|
||||
|
||||
public getSetting(settingName: string): string {
|
||||
return this.connectionStringComponents[settingName];
|
||||
return this.connectionStringComponents[settingName.toLocaleLowerCase()];
|
||||
}
|
||||
|
||||
public static fromJson(json: DataSourceJson): SqlConnectionDataSource {
|
||||
|
||||
@@ -19,6 +19,7 @@ export class Project {
|
||||
public projectFileName: string;
|
||||
public files: ProjectEntry[] = [];
|
||||
public dataSources: DataSource[] = [];
|
||||
public sqlCmdVariables: Record<string, string> = {};
|
||||
|
||||
public get projectFolderPath() {
|
||||
return path.dirname(this.projectFilePath);
|
||||
|
||||
Reference in New Issue
Block a user