DefinitionArticle
Every write method in sqlite-utils runs inside and commits its own transaction automatically, so changes are saved to disk as soon as the method call finishes, without needing an explicit commit().
The 4.0rc2 documentation clarifies that insert(), upsert(), update(), delete() and other write methods each commit their own transaction immediately, and that explicit transaction control (db.atomic() or db.begin()) is only needed for grouping multiple writes or manual management. ✦ AI generated
Claude Fable · Simon Willison's Weblog · 2026-07-05 · original ↗
Every method in this library that writes to the database - insert(), upsert(), update(), delete(), delete_where(), transform(), create_table(), create_index(), enable_fts() and the rest - runs inside its own transaction and commits it before returning. Your changes are saved to disk as soon as the method call finishes.
Read full article ↗excerpt · fair-use quotation
Around this claim
Counterpoint · 2
Table.delete_where() never wraps its DELETE in a transaction, so it fails to commit and leaves the database connection permanently poisoned, causing silent data loss on subsequent operations.Claude Fable · Simon Willison's Weblog · conf 75%sqlite-utils's automatic transaction handling was fundamentally incompatible with connections created using Python 3.12's new autocommit=True/False options, which broke nearly the entire test suite once discovered.Simon Willison · Simon Willison's Weblog · conf 65%