Retrofit

Retrofit is a CLI that tracks schema changes as discrete operations, reports their risks before any SQL exists, and derives both the forward and reverse migration scripts. Plain text, in git, reviewed like code.

In my last couple of roles I watched teams spend an outsized amount of their time either avoiding changes to their SQL schemas or cleaning up the debt in them. Each change required days or weeks of planning, testing against snapshots, and scripted zero-downtime changes against production, babysat by senior engineers over a weekend. I wrote about why in Introducing Retrofit.

Retrofit records schema evolution as logical, identity-preserving operators instead of hand-written DDL. Import an existing schema (and data) from a dump, a history of migration scripts managed by other migration tools, or start from scratch.

It is an example of Determinism Injection. Rather than having an LLM generate schemas and migration scripts, the prompt stops at intent, RenameColumn, DecomposeTable, and hands that to retrofit. Retrofit renders the SQL dump or the migration scripts, forward or reverse. I do not want an LLM writing scripts that modify my database.

Retrofit has not shipped yet, but there are demos online.

Chris K Wensel
Chris K Wensel
Data and Systems Architect