https://github.com/raidenyn/sqldeploy
Simple database creator from sqlproj under .NET Core and Docker environment
https://github.com/raidenyn/sqldeploy
deployment docker dotnet dotnet-core mssql sql sqlprojects
Last synced: 11 months ago
JSON representation
Simple database creator from sqlproj under .NET Core and Docker environment
- Host: GitHub
- URL: https://github.com/raidenyn/sqldeploy
- Owner: raidenyn
- Created: 2018-04-30T17:26:48.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2018-04-30T19:26:55.000Z (almost 8 years ago)
- Last Synced: 2025-04-21T12:55:54.278Z (11 months ago)
- Topics: deployment, docker, dotnet, dotnet-core, mssql, sql, sqlprojects
- Language: C#
- Size: 27.3 KB
- Stars: 5
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# SqlDeploy
A little project for creation new databases in MS SQL Server from SQL Project files under .NET Core and Docker environment.
[](https://ci.appveyor.com/project/raidenyn/sqldeploy/branch/master)
Unfortunately we cannot use Microsoft SSDT under Linux environment to create/migrate database version. But sometimes we want to run our tests from Docker and automatic database creation is really important detail for this. This library allows you to create and remove database easily.
### NuGet installation
``` cmd
dotnet add package SqlDeploy
```
### Limitations
* The lib can create database only. It cannot migrate or update exists databases.
* Creation script doesn't sort your DB objects by relations nad creates objects one by one as they are defined in *.sqlproj file. So you have to sort you objects manually to prevent errors bad relations order.
### Usage sample
``` cs
// Create a deployer
var deployer = new SqlProjectDeployer("path/to/your.sqlproj");
// Create a new db
var database = await deployer.RecreateToAsync(
new SqlConnection(""),
databaseName: "NewDBName");
// You can work with the new DB here
// Delete the database after tests
await database.DeleteAsync();
```