-
Notifications
You must be signed in to change notification settings - Fork 911
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Load profile support for sql project deploy #10948
Conversation
|
||
if (this.readPublishProfile) { | ||
const result = await this.readPublishProfile(fileUris[0]); | ||
(<azdata.InputBoxComponent>this.targetDatabaseTextBox).value = result.databaseName; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is it possible that no db name is there? and in this that case can we keep showing the proj name?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yup in that case, the name will become empty since that's what SSDT does.
let targetDbName: string = ''; | ||
let targetDatabaseNameCount = profileXmlDoc.documentElement.getElementsByTagName(constants.targetDatabaseName).length; | ||
if (targetDatabaseNameCount > 0) { | ||
// if there is more than one TargetDatabaseName nodes, SSDT uses the name in the last one so we'll do the same here |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hmm.. good catch. Why are more than one db names allowed in SSDT?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure. It's pretty strange :/
* 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 PR fixes #10924. This adds support for reading database name and SQLCMD variables from a publish profile. Support for other profile options will be added in later PRs.
Empty state (no profile loaded and no sqlcmdvars in the sqlproj):
This also fixes #10947 so that the values of SQLCMD variables show and change if the profile has different values for them (support for editing them in the UI will come later).