sql-migrate
migrate
Our great sponsors
sql-migrate | migrate | |
---|---|---|
5 | 39 | |
2,501 | 8,969 | |
- | 4.9% | |
4.7 | 7.1 | |
22 days ago | 5 days ago | |
Go | Go | |
MIT License | GNU General Public License v3.0 or later |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
sql-migrate
-
Is there a DB framework that can manage migrations like Ruby on Rails ?
Currently a fan of this one https://github.com/rubenv/sql-migrate
-
Go Echo API Server Development
db migration by sql-migrate
- Most recommended database migration tool? using golang for the record
-
How do you install commands using go.mod
There are some packages in my project that are not used in the source code, but they're used as commands (i.e. https://github.com/vektra/mockery https://github.com/rubenv/sql-migrate).
-
What is the fastest way to clear my SQL database between integration tests?
Keep your migrations in the code repo and use a tool like sql-migrate to automatically apply them for you. At my job, we run a new container for each package's tests, and create a new db with the migration scripts for every test. It's certainly a bit slower, but the reproducibility is worth it.
migrate
-
Does Go have a nice library for database migrations etc without necessarily being a full ORM?
This works well https://github.com/golang-migrate/migrate and can be used as a standalone or as a lib.
- Keeping track of database schema changes
-
Github template for Golang services
For this matter I chose sqlc which offers a good amount of features like support for different dbs and db drivers. Regarding db migrations, I prefer to run them isolated from the code. There are countless tools to manage migrations but recently I've been sticking with go-migrate which also provides a go library in case I want to integrate the migrations into the code.
-
I think go http package + any router is the best combo and its SQL package is much more easier to write and to maintain than Gorm.
We chose golang-migrate for simplicity, maturity, and flexibility. We embedded the library and migrations (believing we'd just run any migrations on startup) but it also gave us the ability to change our mind later - which we did
- 내가 사용할 go(golang) orm 찾기 - ent (3)
-
Why can't docker find this file?
# Build stage FROM golang:1.18.3-alpine AS builder WORKDIR /app COPY . . RUN go build -o main ./cmd/graphql-api/main.go RUN apk add curl RUN curl -L https://github.com/golang-migrate/migrate/releases/download/v4.15.2/migrate.linux-amd64.tar.gz | tar xvz # Run stage FROM alpine WORKDIR /app COPY --from=builder /app/main . COPY --from=builder /app/config/config-docker.yaml ./config/config-docker.yaml COPY --from=builder /app/migrate.linux-amd64 ./migrate COPY start.sh . COPY wait-for.sh . COPY internal/repositories/postgres/migrations ./migrations
-
How to Export MYSQL Database to Postgres On Mac
https://github.com/golang-migrate/migrate This database migration tool is great
-
Embedded database options
This is indeed a concern, but not one I've needed to care about (or the ordering of columns on disk in general). Using an intermediate table might be OK if you use it as part of automatic DB migrations. I use golang-migrate, YMMV.
- Flask SQLAlchemy (with SQLite) in production?
-
Most recommended database migration tool? using golang for the record
Have you looked at go-migrate?
What are some alternatives?
goose
goose - A database migration tool. Supports SQL migrations and Go functions.
gormigrate - Minimalistic database migration helper for Gorm ORM
pgx - PostgreSQL driver and toolkit for Go
sqlx - general purpose extensions to golang's database/sql
go-fixtures - Django style fixtures for Golang's excellent built-in database/sql library.
vitess - Vitess is a database clustering system for horizontal scaling of MySQL.
go-pg-migrations - A Go package to help write migrations with go-pg/pg.
fiber-go-template - 📝 Production-ready backend template with Fiber Go Web Framework for Create Go App CLI.
skeema - Declarative pure-SQL schema management for MySQL and MariaDB
tidb - TiDB is an open-source, cloud-native, distributed, MySQL-Compatible database for elastic scale and real-time analytics. Try free: https://tidbcloud.com/free-trial