golang-migrate/migrate ? reverse-engineered prompt

Reverse engineered prompt

Build me a Go database migration tool that works both as a command line app and as a library I can import in my own projects.

It should let me keep up and down migration files in a folder, read them in the right order, and apply them safely to a database. I want it to support common databases like Postgres, MySQL, SQLite, MongoDB, and the other popular ones people use, plus be able to load migrations from local files and remote sources like GitHub or cloud storage. The CLI should be simple to use with commands for moving migrations up, down, or by a specific number of steps, and it should handle stopping cleanly if I interrupt it. The library should have a clean API, use database URLs, and let me plug in my own logger or existing database connection.

If you need to, look up the current docs online and match the usual migrate workflow.

Are you gonna build this?

make sure you review the code using coderabbit

Try freeSponsored — opens CodeRabbit in a new tab