-
Notifications
You must be signed in to change notification settings - Fork 249
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
Support for SQL Server Database Tools projects #545
Comments
Thanks for your suggestion! At this point, we don't plan to add support for DacPac in NuGet. This is something we might consider in the future |
@karaken12 Are you still working on your fork? |
👍 for dacpac support. |
one should be able to nuget everything 😊 |
👍 for dacpac support. |
For reference, SSDT documentation mentions using dacpac in nuget packages, but only as binaries : https://blogs.msdn.microsoft.com/ssdt/2016/04/06/sqldb-cicd-part3-nuget-db/ |
@Thieum this is for Azure SQL Server DBs & TFS, sqlproj's are not yet support by visual studio |
@andyfenna Totally agree, I wanted to point out that other tools are actually taking advantage of dacpac inside a nuget package, validating the use case. |
Is this ever going to get done? |
I'm building CI tools for our team, and am hooking a part of the build process straight into the .csproj files, to copy the build artifacts out to a staging directory where the larger CI script then finishes transforms/packaging etc., before the packages will be shipped off for deployment. While I am using ReadyRoll and Octopack, I'm building our scripts as a single headless command (the "Integrate Button"), with a tenant to minimize dependency on external tools; the scripts are being built to create simple ZIP archives that can be manually deployed by our support team. Being able to install NuGet packages into .sqlproj projects (and .dbproj) will take the NuGet solution to the next level, with the Continuous Integration problem, as Continuous Database Integration is a critical part of an effective CI/CD solution for a modern, and agile team. Ignoring the need for the DacPac files (it should be irrelevant what kind of files they are, given PowerShell, and the phenomenal design of content delivery via NuGet), we need this! Seriousally, all I need to do is to be able to "Manage NuGet Packages" for my .sqlproj and .dbproj projects; I just need a consistent way to deliver our MSBuild scripts, and other build artifacts, into scope of the project, and to modify the .sqlproj/.dbproj automatically, to import the MSBuild targets file! Please revive this, for the simple fact that we need consistency across the solutions to our common problems! To quote aersamkull - "one should be able to nuget everything 😊". Ivan Pointer |
While I have re-opened this issue, this is just to encourage discussions on the topic so we can gather all the feedback. We are pretty full for the next 2 milestones (untill fall), so even if we decide to do it this probably wont happen this year. |
Another question. Are you able to use nuget.exe install to get around this? Not sure if this going to work but curious to see if you have tried it? |
First, thank you for bringing this back to life Harikrishna! I am very grateful! I haven't yet considered leveraging nuget.exe directly; this may work. To help shed some light on my situation, here's what I'm depending on the NuGet package to do:
What I'm aiming for is an experience much like OctoPack, in that adding the NuGet package to the project is what causes it to be packaged for deploy. Right now, I'm focusing on just producing zip files, but I'd already listed OctoPack as a dependency of our NuGet package, and wired in the appropriate properties to get OctoPack to generate the *.nupkg files on build. Wonderfully enough, ReadyRoll has options for generating Octopus Deploy artifacts on build, and even specifying build numbers. Not only is it dangerous to become too beholden to a "proprietary" tool such as ReadyRoll, I really want to minimize the number of tools that our developers need to interface with, to maximize the chances of success for the process/procedure. Another option I'm strongly considering is a VSIX to handle all this, but my ultimate preference is to solve this with NuGet, as I believe the flexibility and robustness, and ultimately, the simplicity of the tool lends itself better to the problem I'm trying to solve. Perhaps a better solution may be to allow installation of packages marked as a "Development Dependency", on any visual studio project, as I believe that this issue is of a larger scope than just ReadyRoll/Database projects. I've not yet worked with other project types, but I'd imagine there are other project types that could stand to benefit from CI, the granddaddy of Agile software development. I'll keep checking in, and update you with any significant findings/progress I have. Thanks again, |
Looking through the chain of items associated with this one, I've found that a PR was opened for OctoPack to handle this (OctopusDeploy/OctoPack#65), and an issue for OctopusDeploy (OctopusDeploy/Issues#1594), but I think what we really need here is simply the ability to add NuGet packages to DB/SQL projects, and I think this is really a Visual Studio/NuGet thing. If we fix this here, it'll fix the problem for OctoPack and OctopusDeploy. Also, DbUp has caught my eye - it seems simpler than a lot of the competition, and being a console app, doesn't suffer the same issue. I'm continuing to look for angles to this. Thanks, |
I dont know if there is a way to upvote this but this is something we are sorely missing as well. This is a real necessity for CI especially if you dont want to commit dacpacs into GIT/Source control. |
I'm very keen on being able to ad NuGet packages to .sqlproj projects. We generate internal NuGet packages for a product that get installed into different solutions. One package (just been created) holds a set of SQL files and the generated assembly from the product database project. This is mainly to help make DB packaging deployments a lot smoother and less error prone. So for CI/CR/DevOps processes, and as @ivanpointer states for simple consistency in VS, it would great to have this support added. Cheers, Adrian |
This would be useful for myself as well. My use case is to share dacpac dependencies for composite ssdt projects. We have a main sql server project which generates a dacpac and this dacpac will be referenced by many other sql server projects that each own a part of the larger database. Right now I would have to use git submodules to load in main sql server project into each repo or copy dacpac file manually everywhere its used after an update. |
I would really like to see this functionality as well. Currently we are packing the dacpac's as content and using a powershell script to add the reference to the sqlproj file. Would love to see this become a first class citizen. 👍 |
@ChristopherHaws this is exactly how we do it, it would be so much easier and fluent if this functionality was added |
I'm interested in using DACPACs in Nuget to support an empty-database testing package that my applications can use. The idea is to pull the latest dacpac through a nuget dependency, deploy it to localdb, then run your tests against this instance. Having the dacpac nuget-able would greatly simplify pulling in this dependency to the testing project. |
Does anyone have an update on this? |
This should definitely be added. I've spent the last few days converting our development framework from using git submodules to nuget packages and I just got to the modules that have SQL objects that go with them. I was a bit surprised when I found out I couldn't add a nuget package to an SSDT project... it's so natural in Visual Studio I just assumed it was supported. I think it's a common scenario to have a set of SQL objects and some code that need to move together as a unit between projects, especially when you get into large reusable components (for instance, I'm currently trying to nuget-ify our security module along with the SQL objects that code is responsible for). |
+1000 |
We need this in our company too. 👍 |
In my company we use extensively this feature but we are stacked in VS 2013 that actually cover it. Fix it please!. |
+1 |
Is this a NuGet or SSDT/Visual Studio issue or both? I have suggested this feature for Visual Studio as I couldn't find an existing one: |
I hope 2020 and nuget give us the gift of this functionality.... |
I did some experiments yesterday building a custom MSBuild SDK that's capable of producing a DACPAC. I did that using a command line tool that takes a bunch of SQL files as input and uses the public TSqlModel to build a model and then writes it to a DACPAC. That was going quite well and I was even able to install NuGet packages into such a project. However I hit a bit of a blocking issue because it looks like the public model API doesn't support references to other DACPAC's at the moment (see Microsoft/DACExtensions#39). |
So I managed to work around the issue I mentioned earlier and think I've managed to create an MSBuild SDK that provides much of the functionality requested here while sacrificing some features of SSDT. Check out my announcement blog post and the associated repository and NuGet Package. Feedback is more than welcome. |
@jmezach SQLCLR is very valuable to us (my and my colleagues), so though interesting solution this solves nothing for us. (for example CLR is the easiest route I know to get regex support in SQL which can be very usefull) |
@bzuidgeest I guess with some work SQLCLR could be supported as well, it's just that I didn't want to spent time on it if we weren't using it. Feel free to file an issue here. If there's enough demand for it I can consider adding it. Or perhaps someone could send a PR ;). |
I can't believe that we are in 2020 and there is no solution to sqlproj using nuget references. |
@heng-liu what is the |
Hi @StingyJack , sorry for confusion caused, but the Pipeline label is a newly added label for internal use. |
@Condor2708 Have a look at MSBuild.Sdk.SqlProj |
Hi @jmezach , The solution I am working on is using MSBuild:
I have created one task that receives a dacpac.props file where I load the dacpac dependencies. DACPAC PROS <Project>
<ItemGroup>
<Dacpac Include="AddressManager.Database" Version="2.4.0" TargetFramework="net472"/>
<Dacpac Include="EPC.Database" Version="2.4.0" TargetFramework="net472"/>
</ItemGroup>
</Project> sqlproj <UsingTask TaskName="InstallDacpacsTask" AssemblyFile="..\packages\DacpacBuilder.1.0.0.0\Dacpac.Builder.dll" />
<Target Name="InstallDacpacs" BeforeTargets="BeforeBuild">
<InstallDacpacsTask Dacpacs="@(Dacpac)" OutputFolder="$(MSBuildProjectDirectory)\Dacpacs" />
</Target>
<Target Name="ReferenceDacpacs" BeforeTargets="BeforeBuild" DependsOnTargets="InstallDacpacs">
<ItemGroup>
<ArtifactReference Include="Dacpacs\%(Dacpac.Identity).%(Dacpac.Version)\tools\%(Dacpac.Identity).dacpac">
<HintPath>Dacpacs\%(Dacpac.Identity).%(Dacpac.Version)\tools\%(Dacpac.Identity).dacpac</HintPath>
<SuppressMissingDependenciesErrors>False</SuppressMissingDependenciesErrors>
</ArtifactReference>
</ItemGroup>
</Target> |
Any roadmap updates for this? |
So, NuGet Package Manager still isn't supported in database projects?! This (NuGet) is a fundamental tool in VS and should be usable in EVERY Visual Studio project type! Consistency! Consistency! Consistency! It's key. After having this reported in VS 2015 and here we are (a good six years later) in 2021 and this is still a thing? Someone's got questionable engineering/time management skills... |
@lochnar187 Please have a look at MSBuild.Sdk.SqlProj which gets you most of the way. |
A step, but still of no help with a VS db project building CLRs. |
Team Triage: The work that would be required here needs to be done by a different component, the SQL server Database Tools projects and not NuGet. Please upvote and follow the following issue in the DacFx repo, microsoft/DacFx#124. |
FYI, @nkolev92: microsoft/DacFx#124 (comment)
|
This feature is now in preview with the Microsoft.Build.Sql SDK for SQL projects - https://github.com/microsoft/DacFx/blob/main/src/Microsoft.Build.Sql/docs/Functionality.md#package-references |
(Moved from http://nuget.codeplex.com/workitem/2439)
SSDT projects can reference DacPac files, which are similar in concept to assemblies. There is a perceived need for NuGet packages that can install DacPacs into SSDT projects, so that common database code can be shared, e.g. throughout an organisation. SSDT is a core part of VS 2012, so it is likely that more people will be using these project types as time goes on.
Source for NuGet with SSDT project support currently on CodePlex at Karaken12/SsdtProjectSupport. Will move this to Github when I can.
The text was updated successfully, but these errors were encountered: