Implement SQLiteDatabase::Rewrite
Summary:
Rewrite uses the VACUUM command which does exactly what we want. A
specific advertised use case is to compact a database and ensure that
any deleted data is actually deleted.
This is a backport of core#19077 [15/26]
https://github.com/bitcoin/bitcoin/pull/19077/commits/010e3659069e6f97dd7b24483f50ed71042b84b0
Depends on D10562
Test Plan:
With clang-tidy
ninja
Reviewers: #bitcoin_abc, deadalnix
Reviewed By: #bitcoin_abc, deadalnix
Differential Revision: https://reviews.bitcoinabc.org/D10563