Documentation Source Text

Check-in [fcfd6e8be6]
Login

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

Overview
Comment:Document the fact that UPSERTs count INSERT operations but not UPDATEs.
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256:fcfd6e8be65dbc75e6306eb102c1c2c62dd21c6fb66787aa5d6536bf142ce0a8
User & Date: drh 2018-04-20 00:00:28
Context
2018-04-25
00:02
Updates to the change log. check-in: 6d211fe371 user: drh tags: trunk
2018-04-20
00:00
Document the fact that UPSERTs count INSERT operations but not UPDATEs. check-in: fcfd6e8be6 user: drh tags: trunk
2018-04-19
13:28
Preliminary documentation for upsert. check-in: 74564b6da7 user: drh tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to pages/pragma.in.

446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461

    <p>Query or change the count-changes flag. Normally, when the
    count-changes flag is not set, [INSERT], [UPDATE] and [DELETE] statements
    return no data. When count-changes is set, each of these commands 
    returns a single row of data consisting of one integer value - the
    number of rows inserted, modified or deleted by the command. The 
    returned change count does not include any insertions, modifications
    or deletions performed by triggers, or any changes made automatically
    by [foreign key actions].</p>

    <p>Another way to get the row change counts is to use the
    [sqlite3_changes()] or [sqlite3_total_changes()] interfaces.
    There is a subtle different, though.  When an INSERT, UPDATE, or
    DELETE is run against a view using an [INSTEAD OF trigger],
    the count_changes pragma reports the number of rows in the view
    that fired the trigger, whereas [sqlite3_changes()] and







|
|







446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461

    <p>Query or change the count-changes flag. Normally, when the
    count-changes flag is not set, [INSERT], [UPDATE] and [DELETE] statements
    return no data. When count-changes is set, each of these commands 
    returns a single row of data consisting of one integer value - the
    number of rows inserted, modified or deleted by the command. The 
    returned change count does not include any insertions, modifications
    or deletions performed by triggers, any changes made automatically
    by [foreign key actions], or updates caused by an [upsert].</p>

    <p>Another way to get the row change counts is to use the
    [sqlite3_changes()] or [sqlite3_total_changes()] interfaces.
    There is a subtle different, though.  When an INSERT, UPDATE, or
    DELETE is run against a view using an [INSTEAD OF trigger],
    the count_changes pragma reports the number of rows in the view
    that fired the trigger, whereas [sqlite3_changes()] and