All Projects → GuiaBolso → Darwin

GuiaBolso / Darwin

Licence: mit
Database schema evolution library for Go

Programming Languages

go
31211 projects - #10 most used programming language
golang
3204 projects

Projects that are alternatives of or similar to Darwin

Fluentmigrator
Fluent migrations framework for .NET
Stars: ✭ 2,636 (+2253.57%)
Mutual labels:  migration, database
Evolve
Database migration tool for .NET and .NET Core projects. Inspired by Flyway.
Stars: ✭ 477 (+325.89%)
Mutual labels:  migration, database
Yii2 Migration
Yii 2 Migration Creator And Updater
Stars: ✭ 262 (+133.93%)
Mutual labels:  migration, database
Pgloader
Migrate to PostgreSQL in a single command!
Stars: ✭ 3,754 (+3251.79%)
Mutual labels:  migration, database
Migrations
ProcessWire Migrations module
Stars: ✭ 37 (-66.96%)
Mutual labels:  migration, database
Migrate
Database migrations. CLI and Golang library.
Stars: ✭ 2,315 (+1966.96%)
Mutual labels:  migration, database
Roomigrant
Automated Android Room ORM migrations generator with compile-time code generation
Stars: ✭ 349 (+211.61%)
Mutual labels:  migration, database
Goose
A database migration tool. Supports SQL migrations and Go functions.
Stars: ✭ 2,112 (+1785.71%)
Mutual labels:  migration, database
Node Pg Migrate
Node.js database migration management for Postgresql
Stars: ✭ 838 (+648.21%)
Mutual labels:  migration, database
Migrate
Database migrations. CLI and Golang library.
Stars: ✭ 7,712 (+6785.71%)
Mutual labels:  migration, database
Node Sqlite
SQLite client for Node.js applications with SQL-based migrations API written in Typescript
Stars: ✭ 642 (+473.21%)
Mutual labels:  migration, database
Dbmigrations
A library for the creation, management, and installation of schema updates for relational databases.
Stars: ✭ 67 (-40.18%)
Mutual labels:  migration, database
East
node.js database migration tool
Stars: ✭ 53 (-52.68%)
Mutual labels:  migration, database
Laravel Sync Migration
Developer tool helps to sync migrations without refreshing the database
Stars: ✭ 89 (-20.54%)
Mutual labels:  migration, database
Covoiturage Libre
UNMAINTAINED
Stars: ✭ 109 (-2.68%)
Mutual labels:  database
Next
Directus is a real-time API and App dashboard for managing SQL database content. 🐰
Stars: ✭ 111 (-0.89%)
Mutual labels:  database
Gkvdb
[mirror] Go语言开发的基于DRH(Deep-Re-Hash)深度哈希分区算法的高性能高可用Key-Value嵌入式事务数据库。基于纯Go语言实现,具有优异的跨平台性,良好的高可用及文件IO复用设计,高效的底层数据库文件操作性能,支持原子操作、批量操作、事务操作、多表操作、多表事务、随机遍历等特性。
Stars: ✭ 109 (-2.68%)
Mutual labels:  database
Tableqa
AI Tool for querying natural language on tabular data.
Stars: ✭ 109 (-2.68%)
Mutual labels:  database
Sqlitex
An Elixir wrapper around esqlite. Allows access to sqlite3 databases.
Stars: ✭ 111 (-0.89%)
Mutual labels:  database
Spring Data Mock
Mock facility for Spring Data repositories
Stars: ✭ 110 (-1.79%)
Mutual labels:  database

Build Status Go Report Card GoDoc

Try browsing the code on Sourcegraph!

Darwin

Database schema evolution library for Go

Example

package main

import (
	"database/sql"
	"log"

	"github.com/GuiaBolso/darwin"
	_ "github.com/go-sql-driver/mysql"
)

var (
	migrations = []darwin.Migration{
		{
			Version:     1,
			Description: "Creating table posts",
			Script: `CREATE TABLE posts (
						id INT 		auto_increment, 
						title 		VARCHAR(255),
						PRIMARY KEY (id)
					 ) ENGINE=InnoDB CHARACTER SET=utf8;`,
		},
		{
			Version:     2,
			Description: "Adding column body",
			Script:      "ALTER TABLE posts ADD body TEXT AFTER title;",
		},
	}
)

func main() {
	database, err := sql.Open("mysql", "root:@/darwin")

	if err != nil {
		log.Fatal(err)
	}

	driver := darwin.NewGenericDriver(database, darwin.MySQLDialect{})

	d := darwin.New(driver, migrations, nil)
	err = d.Migrate()

	if err != nil {
		log.Println(err)
	}
}

Questions

Q. Why there is not a command line utility?

A. The purpose of this library is just be a library.

Q. How can I read migrations from file system?

A. You can read with the standard library and build the migration list.

Q. Can I put more than one statement in the same Script migration?

A. I do not recommend. Put one database change per migration, if some migration fail, you exactly what statement caused the error. Also only postgres correctly handle rollback in DDL transactions.

To be less annoying you can organize your migrations like? 1.0, 1.1, 1.2 and so on.

Q. Why does not exists downgrade migrations?

A. Please read https://flywaydb.org/documentation/faq#downgrade

Q. Does Darwin perform a roll back if a migration fails?

A. Please read https://flywaydb.org/documentation/faq#rollback

Q. What is the best strategy for dealing with hot fixes?

A. Plese read https://flywaydb.org/documentation/faq#hot-fixes

LICENSE

The MIT License (MIT)

Copyright (c) 2016 Claudemiro

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

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].