返回 2026-07-14
🛠 工具 / 开源

sqlite-utils 4.1.1 发布sqlite-utils 4.1.1

simonwillison.net·2026-07-12 节选正文

sqlite-utils 4.1.1 版本发布,主要修复了在测试 4.1 版本时发现的边缘情况。具体而言,如果在打开事务时调用 `table.transform()`,现在会引发 `TransactionError`,从而避免了潜在的数据库操作冲突。

Simon Willison

Mainly a fix for an edge case that regular Claude chat spotted while experimenting with the 4.1 release to answer a question about ON DELETE.

table.transform() now raises a TransactionError if called while a transaction is open with PRAGMA foreign_keys enabled and the table is referenced by foreign keys with destructive ON DELETE actions - CASCADE, SET NULL or SET DEFAULT. The pragma cannot be changed inside a transaction, so previously dropping the old table as part of the transform could fire those actions and silently delete or modify referencing rows. See Foreign keys and transactions for details and workarounds. (#794) The CLI and Python API documentation now cross-reference each other: CLI sections link to the equivalent Python API functionality and Python API sections link back to the corresponding CLI command. (#791)

需要完整排版与评论请前往来源站点阅读。