Is SQLLite db is dumped ? For which condition ? When ?
Please if not can you implement dumps in order to rollback the db if needed ?
Maybe do a script also to remove pieces that are not in the db after rollback ?
I speak here about hardware crash situations and db corruption improvement. See ya