SQLite Forum

Should we recreate database for these error codes SQLITE_INTERNAL/SQLITE_FORMAT/SQLITE_EMPTY/SQLITE_NOLFS ?
Login
Those errors are indicative of database corruption. However, absence of those errors is not a reliable indicator of absence of corruption. The problem is that not all corruption produces detectable inconsistency in the data structures SQLite maintains. Some corruption may just alter your data.

I can hardly condone a remedy for an application which corrupts the DB which is to just rebuild the DB when SQLite happens to have detected corruption. In fact, I reject the premise underlying your P.S. You are probably suffering data loss (which includes its illegitimate alteration) even when SQLite does not detect the corruption. I think your best course of action is to use those errors, and other indicators such as "pragma integrity_check" failures, to guide your debugging efforts to find out why your application is corrupting the DB.