Documentation Source Text
Check-in [58cdffdea532bea635b07eedcb15fdc65464af48]
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 Ignore Whitespace Patch

Changes to pages/pragma.in

1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114















1115
1116
1117
1118
1119
1120
1121
    <p><b>PRAGMA </b><i>database</i><b>.wal_checkpoint;</b><br>
    <b>PRAGMA </b><i>database</i><b>.wal_checkpoint(PASSIVE);</b><br>
    <b>PRAGMA </b><i>database</i><b>.wal_checkpoint(FULL);</b><br>
    <b>PRAGMA </b><i>database</i><b>.wal_checkpoint(RESTART);</b>
   </p>

    <p>^If the [write-ahead log] is enabled (via the [journal_mode pragma]),
    this pragma causes a checkpoint operation to run on database
    <i>database</i>, or on all attached databases if <i>database</i>
    is omitted.  ^If [write-ahead log] is disabled, this pragma is a
    harmless no-op.</p>

    <p>^Invoking this pragma is equivalent to calling the
    [sqlite3_wal_checkpoint_v2()] C interface with a 
    [SQLITE_CHECKPOINT_PASSIVE | 3rd parameter]
    corresponding to the argument of the PRAGMA.  ^Invoking this
    pragma without an argument is equivalent to calling the
    [sqlite3_wal_checkpoint()] C interface.</p>
















}

Pragma wal_autocheckpoint {
    <p><b>PRAGMA wal_autocheckpoint;<br>
     PRAGMA wal_autocheckpoint=</b><i>N</i><b>;</b></p>

    <p>^This pragma queries or sets the [write-ahead log] 







|

|









>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
    <p><b>PRAGMA </b><i>database</i><b>.wal_checkpoint;</b><br>
    <b>PRAGMA </b><i>database</i><b>.wal_checkpoint(PASSIVE);</b><br>
    <b>PRAGMA </b><i>database</i><b>.wal_checkpoint(FULL);</b><br>
    <b>PRAGMA </b><i>database</i><b>.wal_checkpoint(RESTART);</b>
   </p>

    <p>^If the [write-ahead log] is enabled (via the [journal_mode pragma]),
    this pragma causes a [checkpoint] operation to run on database
    <i>database</i>, or on all attached databases if <i>database</i>
    is omitted.  ^If [write-ahead log] mode is disabled, this pragma is a
    harmless no-op.</p>

    <p>^Invoking this pragma is equivalent to calling the
    [sqlite3_wal_checkpoint_v2()] C interface with a 
    [SQLITE_CHECKPOINT_PASSIVE | 3rd parameter]
    corresponding to the argument of the PRAGMA.  ^Invoking this
    pragma without an argument is equivalent to calling the
    [sqlite3_wal_checkpoint()] C interface.</p>

    <p>^The wal_checkpoint pragma returns a single row with three
    integer columns.  ^The first column is usually 0 but will be
    1 if a RESTART or FULL checkpoint was blocked from completing,
    for example because another thread or process was actively
    using the database.  ^In other words, the first column is 0 if the
    equivalent call to [sqlite3_wal_checkpoint_v2()] would have returned
    [SQLITE_OK] or 1 if the equivalent call would have returned [SQLITE_BUSY].
    ^The second column is the number of modified pages that have been
    written to the write-ahead log file.
    ^The third column is the number of pages in the write-ahead log file
    that have been successfully moved back into the database file at
    the conclusion of the checkpoint.
   ^The second and third column are -1 if there is no
    write-ahead log, for example if this pragma is invoked on a database
    connection that is not in [WAL mode].</p>
}

Pragma wal_autocheckpoint {
    <p><b>PRAGMA wal_autocheckpoint;<br>
     PRAGMA wal_autocheckpoint=</b><i>N</i><b>;</b></p>

    <p>^This pragma queries or sets the [write-ahead log]