Skip to content

Fix VACUUM with an open transaction#798

Open
Sanjays2402 wants to merge 1 commit into
simonw:mainfrom
Sanjays2402:fix/vacuum-open-transaction
Open

Fix VACUUM with an open transaction#798
Sanjays2402 wants to merge 1 commit into
simonw:mainfrom
Sanjays2402:fix/vacuum-open-transaction

Conversation

@Sanjays2402

@Sanjays2402 Sanjays2402 commented Jul 13, 2026

Copy link
Copy Markdown

Database.vacuum() currently passes VACUUM to SQLite while a caller-owned transaction may still be open, which raises OperationalError. Commit that transaction first so the documented maintenance method can run; the regression test verifies both the commit and preserved rows.

Fixes #479


📚 Documentation preview 📚: https://sqlite-utils--798.org.readthedocs.build/en/798/

Database.vacuum() passed VACUUM directly to SQLite, which rejects it while a transaction is open. Commit first so the maintenance operation can run, and cover the reported transaction path with a regression test.

Fixes simonw#479
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

OperationalError: cannot VACUUM from within a transaction

1 participant