azuredatastudio icon indicating copy to clipboard operation
azuredatastudio copied to clipboard

Non-Existent File Display Issue with Wildcard Pattern in .sqlproj

Open Ozzian opened this issue 1 year ago • 1 comments

Type: Bug

  1. Create a new SQL project (.sqlproj) with post-deployment scripts.
  2. Include post-deployment scripts in a separate folder.
  3. Use the wildcard pattern *.sql in the .sqlproj file to include the post-deployment scripts.
  4. Open the project in Azure Data Studio.
  5. Observe that the Data Studio shows a non-existent file "*.sql" in the UI under the folder

The relevant part in the .sqlproj file:

<ItemGroup>
  <PostDeploy Include="Script.PostDeployment.sql" />
  <None Include="PostDeployment\*.sql">
    <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
  </None>
</ItemGroup>

Extension version: 1.4.2 Azure Data Studio version: azuredatastudio 1.48.1 (8825ec21e67a34ede00e4f02a4afc692eb6cab61, 2024-06-13T21:07:19.253Z) OS version: Windows_NT x64 10.0.22631 Restricted Mode: No Preview Features: Enabled Modes:

System Info
Item Value
CPUs 11th Gen Intel(R) Core(TM) i7-11850H @ 2.50GHz (16 x 2496)
GPU Status 2d_canvas: enabled
canvas_oop_rasterization: enabled_on
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: enabled
Load (avg) undefined
Memory (System) 63.71GB (44.46GB free)
Process Argv
Screen Reader no
VM 0%

Ozzian avatar Jul 10 '24 11:07 Ozzian

I'd like to bump this issue. I've been experiencing for ~2 years.

We have a lot of individual scripts that we import to our Pre and Post deployment scripts with the following:

  <ItemGroup>   
    <PostDeploy Include="Scripts\Post.sql">
      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
    </PostDeploy>
    <PreDeploy Include="Scripts\Pre.sql">
      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
    </PreDeploy>    
    <Build Remove="Scripts/Pre/**/*.sql" />
    <Build Remove="Scripts/Post/**/*.sql" />
    <None Include="Scripts/Pre/**/*.sql" />
    <None Include="Scripts/Post/**/*.sql" />
  </ItemGroup>

That renders like this in the database project explorer instead of the individual files.

Image

This makes really cumbersome to navigate the pre & post deployment files as it has to be done in the regular file explorer instead of the database project explorer.

MysterDru avatar Nov 04 '25 15:11 MysterDru