Add use command, add support for local/remote files, add .mdf file attach support #363
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
DRAFT: Not ready for code review yet.
This PR is a partial merge of PR #319, which rounds out the "use" scenario for containers, to allow the casual user who doesn't know containers/linux well, to be able to get going quickly with already existing databases.
This PR adds supports for local files (remote http(s) was already supported), and .mdf files, and adds the
sqlcmd use
sub-command. To follow later will be .bacpac support, and compressed file support. (there are issues right now with these features, in how to reliably do them with the existing mssql container structure)sqlcmd create mssql --use [<local file>|<remote file>]
The T/SQL database name by default becomes the --use file name (without extension). This can be overridden with a ",", e.g.
This will result in the restored database being named [adventure_works] instead of [AdventureWorksLT]
--use now supports .mdf and .bak files
sqlcmd create mssql --use [.mdf|.bak]
the new
sqlcmd use
subcommand allows all of the above, to add a database to an already existing containersqlcmd use [<local file>|<remote file>]
Examples: