All Projects → rdagumampan → Yuniql

rdagumampan / Yuniql

Licence: apache-2.0
Free and open source schema versioning and database migration made natively with .NET Core.

Projects that are alternatives of or similar to Yuniql

Tbls
tbls is a CI-Friendly tool for document a database, written in Go.
Stars: ✭ 940 (+502.56%)
Mutual labels:  snowflake, mysql, postgresql, mariadb, sqlserver, redshift
Liquibase
Main Liquibase Source
Stars: ✭ 2,910 (+1765.38%)
Mutual labels:  sql, database-migrations, mysql, mariadb, sqlserver
Smartsql
SmartSql = MyBatis in C# + .NET Core+ Cache(Memory | Redis) + R/W Splitting + PropertyChangedTrack +Dynamic Repository + InvokeSync + Diagnostics
Stars: ✭ 775 (+396.79%)
Mutual labels:  sql, mysql, postgresql, sqlserver, dotnet-core
Evolve
Database migration tool for .NET and .NET Core projects. Inspired by Flyway.
Stars: ✭ 477 (+205.77%)
Mutual labels:  sql, mysql, postgresql, mariadb, sqlserver
Jet
Type safe SQL builder with code generation and automatic query result data mapping
Stars: ✭ 373 (+139.1%)
Mutual labels:  sql, mysql, postgresql, mariadb
Jsqlparser
JSqlParser parses an SQL statement and translate it into a hierarchy of Java classes. The generated hierarchy can be navigated using the Visitor Pattern
Stars: ✭ 3,405 (+2082.69%)
Mutual labels:  sql, mysql, postgresql, sqlserver
Shmig
Database migration tool written in BASH.
Stars: ✭ 408 (+161.54%)
Mutual labels:  sql, database-migrations, mysql, postgresql
Typeorm
ORM for TypeScript and JavaScript (ES7, ES6, ES5). Supports MySQL, PostgreSQL, MariaDB, SQLite, MS SQL Server, Oracle, SAP Hana, WebSQL databases. Works in NodeJS, Browser, Ionic, Cordova and Electron platforms.
Stars: ✭ 26,559 (+16925%)
Mutual labels:  mysql, postgresql, mariadb, sqlserver
Jooq
jOOQ is the best way to write SQL in Java
Stars: ✭ 4,695 (+2909.62%)
Mutual labels:  sql, mysql, postgresql, sqlserver
Sqlancer
Detecting Logic Bugs in DBMS
Stars: ✭ 672 (+330.77%)
Mutual labels:  sql, mysql, postgresql, mariadb
Nopcommerce
The most popular open-source eCommerce shopping cart solution based on ASP.NET Core
Stars: ✭ 6,827 (+4276.28%)
Mutual labels:  sql, mysql, sqlserver, dotnet-core
Kangaroo
SQL client and admin tool for popular databases
Stars: ✭ 127 (-18.59%)
Mutual labels:  sql, mysql, postgresql, sqlserver
Prisma
Next-generation ORM for Node.js & TypeScript | PostgreSQL, MySQL, MariaDB, SQL Server, SQLite & MongoDB (Preview)
Stars: ✭ 18,168 (+11546.15%)
Mutual labels:  mysql, postgresql, mariadb, sqlserver
DBTestCompare
Application to compare results of two SQL queries
Stars: ✭ 15 (-90.38%)
Mutual labels:  snowflake, mariadb, database-migrations, sqlserver
Sqlx
🧰 The Rust SQL Toolkit. An async, pure Rust SQL crate featuring compile-time checked queries without a DSL. Supports PostgreSQL, MySQL, SQLite, and MSSQL.
Stars: ✭ 5,039 (+3130.13%)
Mutual labels:  sql, mysql, postgresql, mariadb
Fluentmigrator
Fluent migrations framework for .NET
Stars: ✭ 2,636 (+1589.74%)
Mutual labels:  snowflake, sql, mysql, redshift
Linq2db
Linq to database provider.
Stars: ✭ 2,211 (+1317.31%)
Mutual labels:  sql, mysql, postgresql, mariadb
Heidisql
A lightweight client for managing MariaDB, MySQL, SQL Server, PostgreSQL and SQLite, written in Delphi
Stars: ✭ 2,864 (+1735.9%)
Mutual labels:  sql, mysql, postgresql, mariadb
Sequelize
An easy-to-use and promise-based multi SQL dialects ORM tool for Node.js
Stars: ✭ 25,422 (+16196.15%)
Mutual labels:  sql, mysql, postgresql, mariadb
Ddlparse
DDL parase and Convert to BigQuery JSON schema and DDL statements
Stars: ✭ 52 (-66.67%)
Mutual labels:  sql, mysql, postgresql, redshift

yuniql yuniql-build-status AppVeyor tests (branch) Gitter Download latest build Download latest build

yuniql (yuu-nee-kel). Free and open source schema versioning and database migration engine made natively with .NET Core. Use plain SQL scripts, bulk import CSV, integrate CI/CD pipelines, zero runtime dependencies and works with windows and linux. Supports SqlServer, PostgreSql, MySql, MariaDB, Snowflake, and Amazon Redshift.

Working with CLI

Manage local db versions and run database migrations from your CLI tool. Perform local migration run or verify with uncommitted runs to test your scripts. Install yuniql CLI with Chocolatey or use alternative ways listed here https://yuniql.io/docs/install-yuniql

choco install yuniql

Run migrations for SQL Server

docker run -d -e "ACCEPT_EULA=Y" -e "[email protected]!" -p 1400:1433 -d mcr.microsoft.com/mssql/server:2017-latest
SETX YUNIQL_CONNECTION_STRING "Server=localhost,1400;Database=yuniqldb;User Id=SA;Password=[email protected]!"
SETX YUNIQL_WORKSPACE "c:\temp\yuniql-cli\samples\basic-sqlserver-sample"
git clone https://github.com/rdagumampan/yuniql.git c:\temp\yuniql-cli
cd c:\temp\yuniql-cli\samples\basic-sqlserver-sample

yuniql run -a --platform sqlserver
yuniql list --platform sqlserver

Running yuniql v1.0.1 for windows-x64
Copyright 2019 (C) Rodel E. Dagumampan. Apache License v2.0
Visit https://yuniql.io for documentation & more samples

+---------------+----------------------+------------+---------------+----------------------+--------------+
| SchemaVersion | AppliedOnUtc         | Status     | AppliedByUser | AppliedByTool        | Duration     |
+---------------+----------------------+------------+---------------+----------------------+--------------+
| v0.00         | 2021-02-04 06:06:46Z | Successful | sa            | yuniql-cli v1.1.55.0 | 164 ms / 0 s |
+---------------+----------------------+------------+---------------+----------------------+--------------+

Supported databases and platform tests

Amazon Aurora, Azure Synapse and Alibaba Aspara are being evaluated/developed/tested. For running migration from docker container, see instructions here.

Platforms Build Status Description Cloud Infrastructure Documentation
sqlserver yuniql-build-status Sql Server 2017, 2019, latest Azure, GCP, AWS Get started
postgresql yuniql-build-status PostgreSql v9.6, v12.1, latest Azure, GCP, AWS Get started
mysql yuniql-build-status MySql v5.7, v8.0, latest Azure, GCP, AWS Get started
mariadb yuniql-build-status MariaDb v10.2, latest Azure, GCP, AWS Get started
snowflake yuniql-build-status Preview in v1.1.55 (latest) Azure Get started
redshift yuniql-build-status Preview in v1.1.55 (latest) AWS Get started
synapse development Preview build ETA mar 27 2021 Azure

NOTE: Supported cloud platforms are based on limited testing and community feedbacks where users indicated the platform they were attempting to run against. yuniql primarily uses Amazon RDS as cloud provider for non-vendor specific platforms.

Distributions Build Status Description
Docker image linux-x64 yuniql-build-status docker pull yuniql/yuniql:linux-x64-latest
Docker imiage win-x64 yuniql-build-status docker pull yuniql/yuniql:win-x64-latest

Run migrations for PostgreSql, MySql and others

docker run -d -e POSTGRES_USER=sa -e [email protected]! -e POSTGRES_DB=yuniqldb -p 5432:5432 postgres
SETX YUNIQL_CONNECTION_STRING "Host=localhost;Port=5432;Username=sa;Password=[email protected]!;Database=yuniqldb"
SETX YUNIQL_WORKSPACE "c:\temp\yuniql-cli\samples\basic-postgresql-sample"
git clone https://github.com/rdagumampan/yuniql.git c:\temp\yuniql-cli
cd c:\temp\yuniql-cli\samples\basic-postgresql-sample

yuniql run -a --platform postgresql
yuniql list --platform postgresql

Working with Azure DevOps Pipelines Tasks

Run your database migration from Azure DevOps Pipelines. The tasks downloads package and cache it for later execution just like how Use .NET Core or Use Node tasks works. Find Yuniql on Azure DevOps MarketPlace. Developer guide is available here https://yuniql.io/docs/migrate-via-azure-devops-pipelines.

Working with Docker Container

Run your database migration thru a Docker container. This is specially helpful on Linux environments and CI/CD pipelines running on Linux Agents as it facilitates your migration without having to worry any local installations or runtime dependencies. Developer guide is available here https://yuniql.io/docs/migrate-via-docker-container.

git clone https://github.com/rdagumampan/yuniql.git c:\temp\yuniql-docker
cd c:\temp\yuniql-docker\samples\basic-sqlserver-sample

docker build -t sqlserver-example .
docker run sqlserver-example -c "<your-connection-string>" -a --platform sqlserver

Working with ASP.NET Core

Run your database migration when your ASP.NET Core host service starts up. This ensures that database is always at latest compatible state before operating the service. Applies to Worker and WebApp projects. Developer guide is available here https://yuniql.io/docs/migrate-via-aspnetcore-application.

dotnet add package Yuniql.AspNetCore
using Yuniql.AspNetCore;
...
...

//1. deploy new sql server on docker or use existing instance
//$ docker run -dit --name yuniql-sqlserver  -e "ACCEPT_EULA=Y" -e "[email protected]!" -p 1400:1433 -d mcr.microsoft.com/mssql/server:2017-latest

//2. create custom trace message sinks, this can be your own logger framework
var traceService = new ConsoleTraceService { IsDebugEnabled = true };

//3. run migrations
app.UseYuniql(traceService, new Yuniql.AspNetCore.Configuration
{
	Platform = SUPPORTED_DATABASES.SQLSERVER,
	Workspace = Path.Combine(Environment.CurrentDirectory, "_db"),
	ConnectionString = "Server=localhost,1400;Database=helloyuniql;User Id=SA;[email protected]!",
	IsAutoCreateDatabase = true, IsDebug = true
});

Working with .NET Core Console Application

Run your database migration when Console App starts. Developer guide is available here https://yuniql.io/docs/migrate-via-netcore-console-application.

dotnet add package Yuniql.Core
using Yuniql.Core;
...
...

static void Main(string[] args)
{
	//1. deploy new sql server on docker or use existing instance
	//$ docker run -dit -e "ACCEPT_EULA=Y" -e "[email protected]!" -p 1400:1433 -d mcr.microsoft.com/mssql/server:2017-latest

	//2. create custom trace message sinks, this can be your own logger framework
	var traceService = new ConsoleTraceService { IsDebugEnabled = true };

	//3. configure your migration run
	var configuration = Configuration.Instance;
	configuration.Platform = SUPPORTED_DATABASES.SQLSERVER;
	configuration.Workspace = Path.Combine(Environment.CurrentDirectory, "_db");
	configuration.ConnectionString = "Server=localhost,1400;Database=helloyuniql;User Id=SA;[email protected]!";
	configuration.IsAutoCreateDatabase = true;

	//4. run migrations
	var migrationServiceFactory = new MigrationServiceFactory(traceService);
	var migrationService = migrationServiceFactory.Create();
	migrationService.Run();

Advanced use cases

Contributing & asking for help

Please submit ideas for improvement or report a bug by creating an issue.
Alternatively, tag #yuniql on Twitter or drop me a message rdagumampanATgmail.com.

If this is your first time to participate in an open source initiative, you may look at issues labeled as first timer friendly issues. If you found an interesting case, you can fork this repository, clone to your dev machine, create a local branch, and make Pull Requests (PR) so I can review and merge your changes.

To prepare your dev machine, please visit https://github.com/rdagumampan/yuniql/wiki/Setup-development-environment

License

Copyright (C) 2019 Rodel E. Dagumampan

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Credits

Yuniql relies on many open-source projects and we would like to thanks:

Maintainers

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].