Load profile support for sql project deploy (#10948)

* load database name from profile.xml

* load sqlcmd variables from profile

* Add warning text

* add tests

* fix file filter for windows

* add comments

* show SQLCMD variables in a table

* reset dialog before testing readPublishProfile callback
This commit is contained in:
Kim Santiago
2020-06-18 17:44:28 -07:00
committed by GitHub
parent eaf753f79e
commit 6ad33aa879
10 changed files with 205 additions and 11 deletions

View File

@@ -15,3 +15,8 @@ export interface IGenerateScriptProfile {
connectionUri: string;
sqlCmdVariables?: Record<string, string>;
}
export interface PublishSettings {
databaseName: string;
sqlCmdVariables: Record<string, string>;
}

View File

@@ -64,13 +64,7 @@ export class Project {
}
// find all SQLCMD variables to include
for (let i = 0; i < this.projFileXmlDoc.documentElement.getElementsByTagName(constants.SqlCmdVariable).length; i++) {
const sqlCmdVar = this.projFileXmlDoc.documentElement.getElementsByTagName(constants.SqlCmdVariable)[i];
const varName = sqlCmdVar.getAttribute(constants.Include);
const varValue = sqlCmdVar.getElementsByTagName(constants.DefaultValue)[0].childNodes[0].nodeValue;
this.sqlCmdVariables[varName] = varValue;
}
this.sqlCmdVariables = utils.readSqlCmdVariables(this.projFileXmlDoc);
// find all database references to include
for (let r = 0; r < this.projFileXmlDoc.documentElement.getElementsByTagName(constants.ArtifactReference).length; r++) {