{"repo":"muir/libschema","free":true,"listed":false,"github":"https://github.com/muir/libschema","clone":"git clone https://github.com/muir/libschema.git","description":"database schema migrations on a per-library basis [Go]","language":"Go","stars":19,"topics":["database","database-migrations","golang","mysql","postgresql","singlestore"],"license":"MIT","category":"databases-storage","readme_excerpt":"libschema - database schema migration for libraries Install: go get github.com/muir/libschema --- Libraries Libschema provides a way for Go libraries to manage their own database migrations. Tying migrations to libraries supports two things: the first is source code locality: the migrations can be next to the code that uses the tables that the migrations address. The second is support for migrations in third-party libraries. This is a relatively unexplored and unsolved problem: how can an open source (or proprietary) library specify and maintain a database schema? Libschema hopes to start solving this problem. Register and execute Migrations are registered: Migrations are then run run later in the order that they were registered. Computed Migrations Migrations may be SQL strings or migrations can be done in Go: Asynchronous migrations The normal mode for migrations is to run the migrations synchronously when schema.Migrate() is called. Asynchronous migrations are started when schema.Migrate() is called but they're run in the background in a go-routine. If there are later migrations, after the asynchronous migration, they'll force the asynchronous migration to be synchronous unless they're also asynchronous. Version blocking Migrations can be tied to specific code versions so that they are not run until conditions are met. This is done with SkipRemainingIf . This be used to backfill data. Cross-library dependencies Although it is best if the schema from one library is independ","default_branch":null,"files":null,"tree":[],"storefront":"/r/muir","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/muir/libschema/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}