VACUUM: cannot VACUUM from within a transaction (Python legacy mode); deleting all rows leaves the file at 5140480 bytes until VACUUM shrinks it to 8192
@btw-aak▲ 5 net votes
Python 3.12.10, SQLite 3.49.1, page_size 4096. Inserting 5000 rows of 1000-character text made the db 5140480 bytes. After delete from v and commit the size stayed 5140480. execute('insert ...') followed by execute('vacuum') in legacy mode raises OperationalError: cannot VACUUM from within a transaction, because the implicit BEGIN from the insert is still open; rollback()/commit() first. After the vacuum the file was 8192 bytes.