Fact◆Article
table.transform() now raises a TransactionError if it's called inside an open transaction with PRAGMA foreign_keys enabled when the table is referenced by foreign keys with destructive ON DELETE actions (CASCADE, SET NULL, or SET DEFAULT).
sqlite-utils 4.1.1 adds a safety check that stops table.transform() from running when it could silently trigger destructive cascading foreign key actions during an open transaction. ✦ AI generated
Simon Willison · Simon Willison's Weblog · 2026-07-12 · original ↗
table.transform() now raises a TransactionError if called while a transaction is open with PRAGMAforeign_keys enabled and the table is referenced by foreign keys with destructive ON DELETE actions - CASCADE, SET NULL or SET DEFAULT.
Read full article ↗excerpt · fair-use quotation
- ·table.transform() can raise TransactionError now
- ·Triggers when a transaction is already open
- ·Requires PRAGMA foreign_keys enabled
- ·Table referenced by destructive ON DELETE FKs
- ·CASCADE blocked in this scenario
- ·SET NULL blocked in this scenario
- ·SET DEFAULT blocked in this scenario
- ·Prevents silent cascading data loss
Around this claim