Back to section
Willison ⭐ Notable

sqlite-utils 4.0rc1 adds migrations and nested transactions

Pondelok 22. júna 2026 Source: Simon Willison

Main idea

In sqlite-utils 4.0rc1, Willison folds the experimental sqlite-migrate package into core and adds db.atomic() for nested SQLite transactions via savepoints — Django/Peewee style.

Context

sqlite-utils is Willison's flagship Python/CLI SQLite toolkit and underpins the Datasette ecosystem he's been pushing this month (the Jun 18 "Datasette Apps" post). Schema evolution has been a long-running gap — previously handled as a separate sqlite-migrate package. The release coincides with his push to make Datasette a credible app-hosting platform.

Why it matters

For teams running SQLite in production Python apps or building on Datasette, schema evolution becomes a first-class supported workflow rather than a custom script. Breaking changes (upsert syntax, REAL vs FLOAT, dropping Python 3.8) mean teams should pin and test before upgrading.

Details / arguments

  • Migrations built-in: schema changes as decorated Python functions. No reverse migrations by design — fix mistakes by deploying a new forward migration
  • db.atomic() context manager wraps SQLite SAVEPOINTs — safe nested transactions modeled on Django and Peewee
  • Breaking: new upsert syntax, Python 3.8 dropped, view access separated from table access in the API
  • Breaking: float columns now use REAL instead of FLOAT; CSV/TSV type-detection defaults changed
  • RC stage — Willison explicitly invites community testing before a 4.0 stable cut
Open original source Simon Willison