mirror of
https://github.com/simonw/sqlite-utils.git
synced 2026-07-24 18:04:32 +02:00
Fix VACUUM with an open transaction
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 #479
This commit is contained in:
parent
a947dc6739
commit
4af18681ca
2 changed files with 12 additions and 0 deletions
|
|
@ -1897,6 +1897,7 @@ class Database:
|
|||
|
||||
def vacuum(self) -> None:
|
||||
"Run a SQLite ``VACUUM`` against the database."
|
||||
self.commit()
|
||||
self.execute("VACUUM;")
|
||||
|
||||
def analyze(self, name: Optional[str] = None) -> None:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue