Skip to content
Rodel E. Dagumampan edited this page Jan 2, 2020 · 35 revisions

This an express guide to using yuniql-cli. We will use a ready-to-run yuniql database project and deploy to a local SQLServer Server instance. Run the commands line by line via Command Prompt (CMD).

Download yuniql

powershell Invoke-WebRequest -Uri https://github.com/rdagumampan/yuniql/releases/download/latest/yuniql-cli-win-x64-latest-full.zip -OutFile  "c:\temp\yuniql-win-x64-latest.zip"
powershell Expand-Archive "c:\temp\yuniql-win-x64-latest.zip" -DestinationPath "c:\temp\hello-yuniql"

Expand-Archive requires at least powershell v5.0+ running on your machine. You may also download manually here and extract to desired directory.

Download samples

powershell Invoke-WebRequest -Uri https://github.com/rdagumampan/yuniql/releases/download/latest/sqlserver-sample.zip -OutFile  "c:\temp\hello-yuniql.zip"
powershell Expand-Archive "c:\temp\hello-yuniql.zip" -DestinationPath "c:\temp\hello-yuniql"

Expand-Archive requires at least powershell v5.0+ running on your machine. You may also download manually here and extract to desired directory.

Inspect samples directory structure

cd c:\temp\hello-yuniql
dir /O:N

10/21/2019  22:41    <DIR>          _draft
10/21/2019  22:41    <DIR>          _erase
10/21/2019  22:41    <DIR>          _init
10/21/2019  22:41    <DIR>          _post
10/21/2019  22:41    <DIR>          _pre
10/21/2019  22:41    <DIR>          v0.00
10/21/2019  22:46    <DIR>          v1.00
10/21/2019  22:46    <DIR>          v1.01
10/21/2019  22:41                   Dockerfile
10/21/2019  22:41                   README.md
10/21/2019  22:41                   .gitignore

Run migration

yuniql run -a -c "Server=.\;Database=VisitorDB;Trusted_Connection=True;"

Verify your results

//SELECT * FROM [dbo].[Visitor]
VisitorID   FirstName   LastName    Address  Email
----------- ----------- ----------- ------------------------------------------
1000        Jack        Poole       Manila   jack.poole@never-exists.com
1001        Diana       Churchill   Makati   diana.churchill@never-exists.com
1002        Rebecca     Lyman       Rizal    rebecca.lyman@never-exists.com
1003        Sam         Macdonald   Batangas sam.macdonald@never-exists.com
1004        Matt        Paige       Laguna   matt.paige@never-exists.com

Found bugs?

Help us improve further please create an issue.