App dies mid write corrupting db, code is available for review, it’s small.

Dying mid-write to sqlite doesn't corrupt it. It's specifically designed to survive that and other things, which is why it's so useful.