HN Reader

NewTopBestAskShowJob
Show HN: Jetbase – A Python database migration tool (Alembic alternative)
score icon4
comment icon2
5 days agoby jaz1
Hi HN, I built Jetbase — a Python-based database migration tool.

Jetbase has: - strict validation to detect altered or removed migration files after they’ve been applied (prevents drift, fails fast) - database locking so multiple migration processes can’t run at the same time - full rollback support - ascending version numbers enforced directly in filenames so migration history is obvious - uses raw sql instead of ORMs

The main Python tool is Alembic, but it’s mainly used with an ORM and doesn’t include things like validation checks. So I built Jetbase to add the features I was looking for.

Some other things I ran into:

- tools with more validation checks than Alembic were usually Java-based, not Python - some tools gate rollback support behind paid tiers - wanted a way to easily see migrations history

Moved off ORMs to raw SQL, which made Alembic’s ORM integration not necessary. Why I moved off: - explored queries directly in DB UI tools (DBeaver, Snowflake) and didn’t want to rewrite them in ORM syntax - ORMs didn’t make sense for Python data pipelines (S3 → Snowflake → Postgres) - raw SQL was more efficient for things beyond basic CRUD - shared a database with a sister team and didn’t want to create extra ORM models in API to query their stuff

Repo (with a quick start guide): https://github.com/jetbase-hq/jetbase

It currently supports Postgres and SQLite (planning to add more databases)

Would love to hear any feedback!