Skip to content
TopicTracker
From HackerNewsView original
TranslationTranslation

Miglite – raw SQL migrations for Go projects

Miglite is a lightweight Go library for managing raw SQL database migrations, supporting multiple databases like MySQL and SQLite. It uses a local binary for schema versioning with a simple command-line interface for applying and rolling back changes.

Background

Miglite is a new open-source Go library by the developer "inhere" (the Gookit project author) that lets you write database migrations in plain SQL files instead of Go code. Most Go migration tools (like golang-migrate or goose) require you to write migration logic programmatically, which adds boilerplate. Miglite takes the opposite approach: you put raw `CREATE TABLE`, `ALTER TABLE`, etc. in `.sql` files, and it runs them in order. This is closer to how PHP's Phinx or Laravel's raw migration workflows work, but native to Go. The project is part of the broader Gookit ecosystem (a collection of Go utility libraries). For Go developers who prefer SQL over ORMs or code-based migration APIs, Miglite offers a simpler, more database-agnostic alternative — though it lacks the versioning and rollback granularity of tools like golang-migrate.