Menu

Generated SQL migrations for Python, TypeScript and Go projects
📰

Generated SQL migrations for Python, TypeScript and Go projects

DEV Community: typescript·Feroz Shah·11 days ago
#y0jQswK8
#devtotypescript#devto#dev#migrax#schema
Reading 0:00
15s threshold

Migrax started as a tool for Java: it reads JPA entities and writes the SQL migrations that bring the database in line with them. But the idea doesn't depend on Java. Every ORM knows the tables it expects, and almost every ORM can print them as CREATE TABLE statements.

That SQL is all Migrax needs. Keep it in a schema file, and Migrax compares it with what the existing migrations build, writes the next numbered migration with its rollback script, and applies it. This article follows a small Python project through its first changes, then shows the same loop with Drizzle in TypeScript and GORM in Go.

Tested with: Migrax 0.17.2-rc.1, PostgreSQL 17, SQLAlchemy 2.1.6 (Python 3.13), Drizzle ORM 0.45.4 with drizzle-kit 0.31.11 (Node.js 24), GORM 1.31.2 (Go 1.25). Docker runs the throwaway databases.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.