sqlite-utils 4.0, now with database schema migrations
AI-generated summary of reporting by Simon Willison’s Weblog. Read the original for the full story.
Why it matters
Python developers working with SQLite can now run structured schema migrations and nested transactions through sqlite-utils 4.0, eliminating the need for a separate migration library.
Simon Willison released version 4.0 of sqlite-utils, a free open-source command-line tool for managing SQLite databases. Its headline addition is database migrations: an ordered list of changes to a database's structure that the tool tracks and applies automatically. It also adds nested transactions, meaning groups of changes that can be undone together, and support for compound foreign keys. Anyone building small apps or data tools on SQLite is the audience; there are minor breaking changes requiring an upgrade guide.
sqlite-utils 4.0, the first major release since November 2020 and the project's 124th, folds schema migrations directly into the tool, absorbing Willison's separate sqlite-migrate package, which existing dependents keep working via a compatibility shim. The migrations design deliberately skips automatic generation and rollback support, unlike Django's migrations. Teams using the Datasette/LLM ecosystem gain a built-in migration path; minor breaking changes mean checking the upgrade guide before bumping versions.
sqlite-utils 4.0 adds a Migrations API: migration functions decorated via Migrations() are tracked in a _sqlite_migrations table (migration_set, name, applied_at) and applied via 'sqlite-utils migrate data.db migrations.py' or migrations.apply(db). Migrations rely on table.transform(), which implements SQLite's recommended 12-step ALTER TABLE workaround (recreate-copy-drop-rename). Also new: nestable db.atomic() context manager built on SQLite savepoints, and compound foreign key creation and introspection. Upserts now use INSERT ... ON CONFLICT ... DO UPDATE SET. Rollback support is intentionally omitted; the design originated in the sqlite-migrate package released three years ago.
Read the original
This summary exists to save you time, not to replace the source.
Key terms
Was this summary useful?
One click, anonymous. It tells us which summaries to re-run.
Related reading
Code-driven AI illustrations are more useful than images from dedicated image models
Code-driven AI illustrations let designers edit assets directly in code, saving time on iteration and ensuring consistency, which is a game-changer for teams that need rapid, reusable visual content.
A hierarchical note-taking app for building large personal knowledge bases
Trilium lets users build and navigate massive personal knowledge bases without duplicating content, saving time on organization and retrieval.
Desktop apps in Go with native UI or web frontend
Go developers can now ship cross-platform desktop and mobile apps in a single small binary without cgo or heavy runtimes, cutting build complexity and deployment size.
OpenBitFun: an agent workspace with four harness modes and phone remote control
OpenBitFun lets agents run on any machine and be controlled from a phone, eliminating the need to choose between local power and remote access, saving developers time switching contexts.
Intel One Mono: a monospaced font designed with low-vision developers
Developers with low vision or eye fatigue can read code more clearly, reducing errors and improving productivity.