mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-02-22 06:52:36 +01:00
Implement SQLiteDatabase::Rewrite
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 commit is contained in:
parent
010e365906
commit
b4df8fdb19
1 changed files with 3 additions and 1 deletions
|
@ -181,7 +181,9 @@ void SQLiteDatabase::Open()
|
||||||
|
|
||||||
bool SQLiteDatabase::Rewrite(const char* skip)
|
bool SQLiteDatabase::Rewrite(const char* skip)
|
||||||
{
|
{
|
||||||
return false;
|
// Rewrite the database using the VACUUM command: https://sqlite.org/lang_vacuum.html
|
||||||
|
int ret = sqlite3_exec(m_db, "VACUUM", nullptr, nullptr, nullptr);
|
||||||
|
return ret == SQLITE_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool SQLiteDatabase::Backup(const std::string& dest) const
|
bool SQLiteDatabase::Backup(const std::string& dest) const
|
||||||
|
|
Loading…
Add table
Reference in a new issue