How to corrupt an SQLite database file
- Databases
- Infrastructure
- Programming
- Security
The linked page is official SQLite documentation cataloging concrete ways a database can get corrupted. It reads like a failure postmortem index. The list includes obvious hazards like editing the file directly or copying it while writes are in flight, but the more interesting cases are environmental. SQLite calls out broken or nonstandard filesystem locking, multiple SQLite libraries linked into one application, writes landing on the wrong file descriptor, and storage or OS layers that violate the assumptions SQLite depends on.
If you ship SQLite, the main risk is rarely the core engine. Audit your surrounding stack instead: how you package SQLite, copy live databases, use extensions like FTS5, and interact with filesystems, backups, and security software.
- sqlite.org
- Discuss on HN