Automatically add new items to the .sqlproj file (Database Project extension) #24860
Replies: 1 comment
-
Hi! I understand that when you're using Solution Explorer in Visual Studio, you are able to add files that are included in the SQL project immediately. If you switch that panel to the "Folder" view, you see the files and folders in the solution directory, but the project rendering is not available. You sound like an expert that has a grasp on this, but in case someone else comes along I'm dropping this docs link: https://learn.microsoft.com/en-us/visualstudio/ide/use-solution-explorer?view=vs-2022 In Azure Data Studio both the options are available simultaneously, but in different views accessed in the activity bar. I grabbed both for the image below, where on the left I'm displaying a SQLproj folder in the "Explorer" view on the left, which is the default for applications like Azure Data Studio and VS Code. On the right is the "Database Projects" view in Azure Data Studio, which in analogous to the Solution Explorer in Visual Studio. If you add files in this view, they are added to the project. Ok, ready for stuff to get real fun? 🥳 Everything above applies to "SQL projects" (compatible with SSDT and Azure Data Studio). These existing SQL projects use the extremely verbose project file format where each file must be manually added to the folder and this is why using the "Database Projects" view in ADS and Solution Explorer in Visual Studio is so important. In Azure Data Studio there's also the "SDK-style SQL projects", which are currently in preview and are not compatible with SSDT at this time. However, these projects also include every *.sql file in folders nested from the .sqlproj file, so you can add/move/remove files however you want for these projects. Much of the functionality for the existing "SQL projects" works with SDK-style SQL projects, there's a recap of their capabilities here: https://learn.microsoft.com/en-us/azure-data-studio/extensions/sql-database-project-extension-sdk-style-projects |
Beta Was this translation helpful? Give feedback.
-
Coming from Visual Studio, when I created new tables or views in the solution there they automatically got added to the .sqlproj file alongside all the other files. This behavior is not present in the Database Project extension in ADS, as I need to manually add each existing item I have created, even though I make the file in the solution. ADS is superior in almost every way, but this problem adds a lot of manual work. I have tried to search for a solution for this but couldn't find anything similar on the web. Is there a plan to include this in the extension in the future?
Beta Was this translation helpful? Give feedback.
All reactions