Documentation Source Text

Check-in [e7ebad87a6]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Clarify the language in the opening paragraphs of the file format document.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: e7ebad87a6ed012cb15553419687b9036bec60df
User & Date: drh 2011-08-04 21:57:41.327
Context
2011-08-09
19:22
Update the "crew.html" page to show Joe's picture and bio. (check-in: 127b4cc937 user: drh tags: trunk)
2011-08-04
21:57
Clarify the language in the opening paragraphs of the file format document. (check-in: e7ebad87a6 user: drh tags: trunk)
2011-07-20
13:49
Fix typos in the file format document. (check-in: 81951052dc user: drh tags: trunk)
Changes
Unified Diff Ignore Whitespace Patch
Changes to pages/fileformat2.in.
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23

24
25
26
27
28
29
30
31
32
33
34
format used by SQLite.</p>

<h2>1.0 The Database File</h2>

<p>The complete state of an SQLite database is usually
contained a single file on disk called the "main database file".</p>

<p>While performing a transaction, the default behavior is to stores 
some temporary information in a second file called the "rollback journal".
(The alternative is to use a [write-ahead log] - described separately.)
If the application or
host computer crashes before completing the transaction, then the rollback
journal contains critical state information needed to restore the
content of the main database file.  When a rollback journal contains
information necessary for recovering the state of the database, we say

that it is a "hot journal".  Hot journals only come up in an error recovery
scenario and so are uncommon, but they are part of the state of an SQLite
database and so should not be ignored.  This document defines the format
of a rollback journal (and the write-ahead log file), but main focus is
on the main database file.</p>

<h3>1.1 Pages</h3>

<p>The main database file consists of one or more pages.  ^The size of a
page is a power of two between 512 and 65536 inclusive.  All pages within
the same database are the same size.  ^The page size for a database file







|
|
|

|
|
|
|
>
|
|
|
|







9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
format used by SQLite.</p>

<h2>1.0 The Database File</h2>

<p>The complete state of an SQLite database is usually
contained a single file on disk called the "main database file".</p>

<p>During a transaction, SQLite stores additional information 
in a second file called the "rollback journal", or if SQLite is in
[WAL mode], a write-ahead log file.
If the application or
host computer crashes before the transaction completes, then the rollback
journal or write-ahead log contains critical state information needed 
to restore the main database file to a consistent state.  When a rollback 
journal or write-ahead log contain information necessary for recovering 
the state of the database, they are called a "hot journal" or "hot WAL file".
Hot journals and WAL files are only a factor during error recovery
scenarios and so are uncommon, but they are part of the state of an SQLite
database and so cannot be ignored.  This document defines the format
of a rollback journal and the write-ahead log file, but main focus is
on the main database file.</p>

<h3>1.1 Pages</h3>

<p>The main database file consists of one or more pages.  ^The size of a
page is a power of two between 512 and 65536 inclusive.  All pages within
the same database are the same size.  ^The page size for a database file