Documentation Source Text
Check-in [58cdffdea5]
Not logged in

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

Overview
SHA1 Hash:58cdffdea532bea635b07eedcb15fdc65464af48
Date: 2012-09-11 11:04:00
User: drh
Comment:Add information on the values returned by the wal_checkpoint pragma.
Tags And Properties
Changes
hide diffs unified diffs patch

Changes to pages/pragma.in

1096 <p><b>PRAGMA </b><i>database</i><b>.wal_checkpoint;</b><br> 1096 <p><b>PRAGMA </b><i>database</i><b>.wal_checkpoint;</b><br> 1097 <b>PRAGMA </b><i>database</i><b>.wal_checkpoint(PASSIVE);</b><br> 1097 <b>PRAGMA </b><i>database</i><b>.wal_checkpoint(PASSIVE);</b><br> 1098 <b>PRAGMA </b><i>database</i><b>.wal_checkpoint(FULL);</b><br> 1098 <b>PRAGMA </b><i>database</i><b>.wal_checkpoint(FULL);</b><br> 1099 <b>PRAGMA </b><i>database</i><b>.wal_checkpoint(RESTART);</b> 1099 <b>PRAGMA </b><i>database</i><b>.wal_checkpoint(RESTART);</b> 1100 </p> 1100 </p> 1101 1101 1102 <p>^If the [write-ahead log] is enabled (via the [journal_mode pragma]), 1102 <p>^If the [write-ahead log] is enabled (via the [journal_mode pragma]), 1103 this pragma causes a checkpoint operation to run on database | 1103 this pragma causes a [checkpoint] operation to run on database 1104 <i>database</i>, or on all attached databases if <i>database</i> 1104 <i>database</i>, or on all attached databases if <i>database</i> 1105 is omitted. ^If [write-ahead log] is disabled, this pragma is a | 1105 is omitted. ^If [write-ahead log] mode is disabled, this pragma is a 1106 harmless no-op.</p> 1106 harmless no-op.</p> 1107 1107 1108 <p>^Invoking this pragma is equivalent to calling the 1108 <p>^Invoking this pragma is equivalent to calling the 1109 [sqlite3_wal_checkpoint_v2()] C interface with a 1109 [sqlite3_wal_checkpoint_v2()] C interface with a 1110 [SQLITE_CHECKPOINT_PASSIVE | 3rd parameter] 1110 [SQLITE_CHECKPOINT_PASSIVE | 3rd parameter] 1111 corresponding to the argument of the PRAGMA. ^Invoking this 1111 corresponding to the argument of the PRAGMA. ^Invoking this 1112 pragma without an argument is equivalent to calling the 1112 pragma without an argument is equivalent to calling the 1113 [sqlite3_wal_checkpoint()] C interface.</p> 1113 [sqlite3_wal_checkpoint()] C interface.</p> 1114 1114 > 1115 <p>^The wal_checkpoint pragma returns a single row with three > 1116 integer columns. ^The first column is usually 0 but will be > 1117 1 if a RESTART or FULL checkpoint was blocked from completing, > 1118 for example because another thread or process was actively > 1119 using the database. ^In other words, the first column is 0 if the > 1120 equivalent call to [sqlite3_wal_checkpoint_v2()] would have returned > 1121 [SQLITE_OK] or 1 if the equivalent call would have returned [SQLITE_BUSY]. > 1122 ^The second column is the number of modified pages that have been > 1123 written to the write-ahead log file. > 1124 ^The third column is the number of pages in the write-ahead log file > 1125 that have been successfully moved back into the database file at > 1126 the conclusion of the checkpoint. > 1127 ^The second and third column are -1 if there is no > 1128 write-ahead log, for example if this pragma is invoked on a database > 1129 connection that is not in [WAL mode].</p> 1115 } 1130 } 1116 1131 1117 Pragma wal_autocheckpoint { 1132 Pragma wal_autocheckpoint { 1118 <p><b>PRAGMA wal_autocheckpoint;<br> 1133 <p><b>PRAGMA wal_autocheckpoint;<br> 1119 PRAGMA wal_autocheckpoint=</b><i>N</i><b>;</b></p> 1134 PRAGMA wal_autocheckpoint=</b><i>N</i><b>;</b></p> 1120 1135 1121 <p>^This pragma queries or sets the [write-ahead log] 1136 <p>^This pragma queries or sets the [write-ahead log]