Skip to content
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

Add check for duplicate SQL build items #574

Merged
merged 3 commits into from
Feb 27, 2025
Merged

Add check for duplicate SQL build items #574

merged 3 commits into from
Feb 27, 2025

Conversation

zijchen
Copy link
Member

@zijchen zijchen commented Feb 27, 2025

The SDK's implicit globbing pattern (**/*.sql) may conflict with any explicit includes with metadata in the project file. Normally MSBuild is smart enough to resolve the duplicates, but the additional metadata makes it think that the items are different, which may result in a significant performance impact during the build process.

I'm adding a check similar to the CheckForDuplicateItems target that will fail the build if any explicit includes are already covered by the default globbing pattern. Project authors would either need to remove the explicit includes or disable the default globbing pattern by setting EnableDefaultSqlItems to false. Additional metadata should be attached using Update instead:

<Build Update="Table1.sql" Metadata="Value" />
  <Metadata>Value</Metadata>
</Build>

@zijchen zijchen linked an issue Feb 27, 2025 that may be closed by this pull request
@zijchen zijchen merged commit 32d31c8 into main Feb 27, 2025
7 checks passed
@zijchen zijchen deleted the zijchen/issue561 branch February 27, 2025 21:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Exceptionally long build times compared to the old sqlproj format.
3 participants