Skip to content

Commit

Permalink
Added readme
Browse files Browse the repository at this point in the history
  • Loading branch information
raidenyn committed Apr 30, 2018
1 parent 868f705 commit 03f0e88
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# SqlDeploy

A little project for creation new databases in MS SQL Server from SQL Project files under .NET Core and Docker environment.

[![Build status](https://ci.appveyor.com/api/projects/status/oi9nqy36rgj5b9se/branch/master?svg=true)](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("<connection string to MS SQL>"),
databaseName: "NewDBName");

// You can work with the new DB here
// Delete the database after tests
await database.DeleteAsync();
```

0 comments on commit 03f0e88

Please sign in to comment.