The Information Machine

sqlite-utils 4.0rc1 adds migrations and nested transactions

Simon Willison · Simon Willison · 2026-06-21

Simon Willison releases sqlite-utils 4.0rc1, adding built-in database migrations ported from sqlite-migrate and nested transaction support via a new db.atomic() context manager, along with several breaking changes ahead of a stable v4 release.

Open original ↗

Appears in

Extraction

Topics: sqlitepythonopen-source-toolsdatabase-migrations

Claims

  • sqlite-utils 4.0rc1 bundles a migrations system ported from the sqlite-migrate package, supporting Python-defined and CLI-driven schema migrations.
  • The new db.atomic() context manager enables nested SQLite transactions using savepoints, borrowing terminology from Django and Peewee.
  • v4 drops Python 3.8 support and adds Python 3.13 support.
  • Upsert operations now default to SQLite's INSERT...ON CONFLICT SET syntax rather than the previous INSERT OR IGNORE followed by UPDATE.
  • The default floating-point column type changed from FLOAT to REAL to match correct SQLite semantics.

Key quotes

The system is deliberately small: it doesn't provide reverse migrations, so any mistakes you make should be fixed by deploying a fresh migration to undo them.
I borrowed the terminology 'atomic' from Django and Peewee.