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.
pull/19077/head
Andrew Chow 5 years ago
parent 010e365906
commit b4df8fdb19

@ -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…
Cancel
Save