#database migrations

sqlite-utils 4.0 adds database migrations and nested transactions

simonwillison.net · ⭐️ 8/10 · 2026-07-07

8/10

sqlite-utils 4.0, released on July 7, 2026, introduces three major features: database schema migrations, nested transactions via a new db.atomic() method, and support for compound foreign keys. This release significantly enhances sqlite-utils as a tool for managing SQLite databases, addressing common needs for schema versioning and transactional safety. Developers using Python for data management will benefit from easier migration workflows and more robust transaction handling. Migrations are defined in Python files using the Migrations class and the table.transform() method, which implements SQLite's recommended pattern of creating a temporary table. Nested transactions use SQLite savepoints under the hood, and compound foreign keys allow referencing multiple columns.