Get the latest tech news
SQLite's File Format
This document describes and defines the on-disk database file format used by all releases of SQLite since version 3.0.0 (2004-06-18). The complete state of an SQLite database is usually contained in a single file on disk called the "main database file".
If the application or host computer crashes before the transaction completes, then the rollback journal or write-ahead log contains information needed to restore the main database file to a consistent state. A bug in SQLite versions prior to 3.6.0 (2008-07-16) caused the database to be reported as corrupt if any of the last 6 entries in the freelist trunk page array contained non-zero values. A different random nonce is used each time a transaction is started in order to minimize the risk that unwritten sectors might by chance contain data from the same page that was a part of prior journals.
Or read this on Hacker News