Simple, minimal SQL database migrations written in Go with generics. Std lib database/sql and SQLX supported OOTB
7 points by ogg
7 points by ogg
I built GoSMig for personal projects and open-sourced it. It’s a tiny library for writing migrations in Go (compile-time checks via generics). Supports both transactional and non-transactional steps, rollback, status/version commands, and a built-in CLI handler so you can ship your own tool.
Repo: https://github.com/padurean/gosmig Examples: https://github.com/padurean/gosmig/tree/examples
Curious how this compares to your current workflow and what would make it adoptable at work.
Are there any notable differences to existing migrate tools?
specifically what are the differences to goose, golang-migrate/migrate or ariga/atlas
It's mostly a subset of features of the existing tools. I created it after being annoyed while trying to find my way on how to use goose to build my own migration CLI with it with no plain SQL migrations - only with migrations written in Go (with sqlx), which are embedded in the migration binary, without any external dir containing SQL files.
So i built just that:
I also wanted to see if i could make use of Go's generics (which are sort of limited/incomplete) to achieve this.