microsoft / microsoft/DacFx

extracting empty database with extract target != dacpac or file results in incorrect success message

Open
#324 0 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
C#
Stars
460
Forks
29
Avg merge
4d 9h
Merged PRs (30d)
7

Description

- SqlPackage or DacFx Version: 162.1.x
- .NET Framework (Windows-only) or .NET Core: core
- Environment (local platform and source/target platforms): sql 2022 and fabric dw

**Steps to Reproduce:**

1. create an empty (new) database
2. run sqlpackage extract with extract target property set to anything that should result in a set of folders (not dacpac or file)
3. sqlpackage succeeds (correct) and gives a message that it has saved the output to the file/folder specified
4. the outer folder should exist, but it was not created. by contract, extracting to a dacpac results in a single empty dacpac file

```bash
➜ sqlpackage ./sqlpackage /a:extract /p:ExtractTarget=Flat /tf:something.dacpac /scs:"Server=localhost;Initial Catalog=imempty;User ID=sa;Password=somepasswordthatsnotgreat;TrustServerCertificate=true"
Connecting to database 'imempty' on server 'localhost'.
Extracting schema
Extracting schema from database
Resolving references in schema model
Exporting database objects
Validating schema model for data package
Validating schema
Successfully extracted database and saved it to file '/Users/drewsk/Downloads/sqlpackage/something.dacpac'.
Changes to connection setting default values were incorporated in a recent release. More information is available at https://aka.ms/dacfx-connection
Time elapsed 0:00:02.49
➜ sqlpackage cd something.dacpac
cd: no such file or directory: something.dacpac
```

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the sqlpackage extract command against an empty database with ExtractTarget=Flat, then trace the extraction-target handling and success-message path. Done means the expected outer folder exists for folder-based targets and the success message accurately identifies the created output; verify the existing dacpac behavior remains unchanged.

Written by the indexing model from the issue text.

Assessment

Tech stack
sql
Domain
cli, databases
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
50/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.