frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Open in hackernews

Show HN: Jetbase – A Python database migration tool (Alembic alternative)

https://github.com/jetbase-hq/jetbase
3•jaz1•1d ago
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!

Comments

dmarwicke•1d ago
the sql-first thing is interesting. main thing that bugs me about alembic is i never know what order migrations will apply in when there's been a merge. how does jetbase handle branching?
jaz1•1d ago
Branching is less of an issue than with alembic because each alembic migration is tied to a down revision which causes multiple heads.

In jetbase, migrations are linear. They're applied in ascending version order. So there will always only be one head. any versions introduced that are the same or lower than the current head will fail their migration.

In alembic:

- Current head is A - dev1 adds migration B (A -> B) - dev2 adds migration C (A -> C) - This now causes multiple heads

In jetbase:

- Current head is 1 - dev1 adds migration 2 - dev2 adds migration 2 (but different file contents then branch 1) - The second migration will fail. its version will have to be updated to be > 2 to pass.

jetbase example 2:

- Current head is 1 - dev1 adds migration 2 - dev2 adds migration 3 - if dev1 runs first, then all migrations will be successful. if dev2 runs first, then dev1 will fail because its version is lower than the new head (3)

(sidenote - you can also use 'jetbase new "migration_description"' to automatically generate a new migration file using a timestamp as the version. This can also help stop version conflicts)

In jetbase, it's also easy to see in what order any pending migrations will apply using 'jetbase status'. Below I've listed the migration order related commands.

jetbase status - shows all applied migrations (in order) vs. pending migrations (in order)

jetbase history - shows all applied migrations in order and when they were applied

jetbase current - shows latest migration (head)

Show HN: Terminal UI for AWS

https://github.com/huseyinbabal/taws
208•huseyinbabal•7h ago•97 comments

Show HN: An interactive guide to how browsers work

https://howbrowserswork.com/
184•krasun•12h ago•29 comments

Show HN: Hover – IDE style hover documentation on any webpage

https://github.com/Sampsoon/hover
40•sampsonj•8h ago•18 comments

Show HN: An LLM-Powered PCB Schematic Checker (Major Update)

https://traceformer.io/
34•wafflesfreak•5h ago•15 comments

Show HN: Quantum Tunnel

https://chuanqisun.github.io/quantum-tunnel/
23•osmoscraft•4h ago•11 comments

Show HN: I used AI to recreate a $4000 piece of audio hardware as a plugin

134•johnwheeler•2d ago•96 comments

Show HN: H-1B Salary Data Explorer

11•zuhayeer•5h ago•6 comments

Show HN: Claude Reflect – Auto-turn Claude corrections into project config

https://github.com/BayramAnnakov/claude-reflect
72•Bayram•23h ago•26 comments

Show HN: Replacing my OS process scheduler with an LLM

https://github.com/mprajyothreddy/brainkernel
69•ImPrajyoth•5d ago•38 comments

Show HN: I made R/place for LLMs

https://art.heimdal.dev
8•ekvanox•7h ago•1 comments

Show HN: Magic CSV – Transform CSVs with plain English, no formulas

https://magiccsv.app/
16•bored-developer•4d ago•2 comments

Show HN: Offline tiles and routing and geocoding in one Docker Compose stack

https://www.corviont.com/
97•packet_mover•1d ago•37 comments

Show HN: Remember Me – O(1) Client-Side Memory (40x cheaper than Vector DBs)

https://github.com/merchantmoh-debug/Remember-Me-AI
2•MohskiBroskiAI•7h ago•4 comments

Show HN: Get a brief before every meeting (open-source)

https://www.briefmymeeting.com
5•elieskilled•7h ago•0 comments

Show HN: Website that plays the lottery every second

https://lotteryeverysecond.lffl.me/
257•Loeffelmann•2d ago•140 comments

Show HN: uvx ptn, scan a QR, get a terminal in your phone

https://github.com/lyehe/porterminal
98•yxl448•1d ago•42 comments

Show HN: I built an HTTP/2 server in C++ to learn the protocol and language

https://github.com/rhargreaves/ion
7•kiyouta•16h ago•0 comments

Show HN: Calgebra – Set algebra for calendars in Python

https://github.com/ashenfad/calgebra
3•ashenfad•9h ago•1 comments

Show HN: Krowdovi – Video-based indoor navigation on a DePIN creator economy

https://github.com/daftpixie/krowdovi
9•24hrmvp•23h ago•26 comments

Show HN: I built an international calling platform for the past 6 months

https://voklit.com
34•ahmgeek•1d ago•37 comments

Show HN: Til.re – The URL is your timer, no signup required

https://til.re
14•iamlin•1d ago•5 comments

Show HN: Use Claude Code to Query 600 GB Indexes over Hacker News, ArXiv, etc.

https://exopriors.com/scry
392•Xyra•4d ago•140 comments

Show HN: An update-aware approach to incremental sorting (DeltaSort)

https://github.com/shudv/deltasort
3•shudv•15h ago•1 comments

Show HN: OpenWorkers – Self-hosted Cloudflare workers in Rust

https://openworkers.com/introducing-openworkers
499•max_lt•3d ago•156 comments

Show HN: Rails-like web framework for Go

https://github.com/mbvlabs/andurel
5•mbvisti•15h ago•0 comments

Show HN: Log Voyager – View 10GB+ log files in browser without crashing RAM

https://www.logvoyager.cc/
3•murzynalbinos•17h ago•2 comments

Show HN: Enroll, a tool to reverse-engineer servers into Ansible config mgmt

https://enroll.sh
263•_mig5•4d ago•54 comments

Show HN: Wario Synth – Turn any song into Game Boy version

https://www.wario.style
72•birdmania•3d ago•17 comments

Show HN: BusterMQ, Thread-per-core NATS server in Zig with io_uring

https://bustermq.sh/
133•jbaptiste•4d ago•69 comments

Show HN: FP-pack – Functional pipelines in TypeScript without monads

https://github.com/superlucky84/fp-pack
14•superlucky84•1d ago•16 comments