extralite-bundle 1.26 → 2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -146,9 +146,9 @@ extern "C" {
146
146
  ** [sqlite3_libversion_number()], [sqlite3_sourceid()],
147
147
  ** [sqlite_version()] and [sqlite_source_id()].
148
148
  */
149
- #define SQLITE_VERSION "3.40.1"
150
- #define SQLITE_VERSION_NUMBER 3040001
151
- #define SQLITE_SOURCE_ID "2022-12-28 14:03:47 df5c253c0b3dd24916e4ec7cf77d3db5294cc9fd45ae7b9c5e82ad8197f38a24"
149
+ #define SQLITE_VERSION "3.42.0"
150
+ #define SQLITE_VERSION_NUMBER 3042000
151
+ #define SQLITE_SOURCE_ID "2023-05-16 12:36:15 831d0fb2836b71c9bc51067c49fee4b8f18047814f2ff22d817d25195cf350b0"
152
152
 
153
153
  /*
154
154
  ** CAPI3REF: Run-Time Library Version Numbers
@@ -563,6 +563,7 @@ SQLITE_API int sqlite3_exec(
563
563
  #define SQLITE_CONSTRAINT_DATATYPE (SQLITE_CONSTRAINT |(12<<8))
564
564
  #define SQLITE_NOTICE_RECOVER_WAL (SQLITE_NOTICE | (1<<8))
565
565
  #define SQLITE_NOTICE_RECOVER_ROLLBACK (SQLITE_NOTICE | (2<<8))
566
+ #define SQLITE_NOTICE_RBU (SQLITE_NOTICE | (3<<8))
566
567
  #define SQLITE_WARNING_AUTOINDEX (SQLITE_WARNING | (1<<8))
567
568
  #define SQLITE_AUTH_USER (SQLITE_AUTH | (1<<8))
568
569
  #define SQLITE_OK_LOAD_PERMANENTLY (SQLITE_OK | (1<<8))
@@ -1175,7 +1176,6 @@ struct sqlite3_io_methods {
1175
1176
  ** in wal mode after the client has finished copying pages from the wal
1176
1177
  ** file to the database file, but before the *-shm file is updated to
1177
1178
  ** record the fact that the pages have been checkpointed.
1178
- ** </ul>
1179
1179
  **
1180
1180
  ** <li>[[SQLITE_FCNTL_EXTERNAL_READER]]
1181
1181
  ** The EXPERIMENTAL [SQLITE_FCNTL_EXTERNAL_READER] opcode is used to detect
@@ -1188,16 +1188,16 @@ struct sqlite3_io_methods {
1188
1188
  ** the database is not a wal-mode db, or if there is no such connection in any
1189
1189
  ** other process. This opcode cannot be used to detect transactions opened
1190
1190
  ** by clients within the current process, only within other processes.
1191
- ** </ul>
1192
1191
  **
1193
1192
  ** <li>[[SQLITE_FCNTL_CKSM_FILE]]
1194
- ** Used by the cksmvfs VFS module only.
1193
+ ** The [SQLITE_FCNTL_CKSM_FILE] opcode is for use interally by the
1194
+ ** [checksum VFS shim] only.
1195
1195
  **
1196
1196
  ** <li>[[SQLITE_FCNTL_RESET_CACHE]]
1197
1197
  ** If there is currently no transaction open on the database, and the
1198
- ** database is not a temp db, then this file-control purges the contents
1199
- ** of the in-memory page cache. If there is an open transaction, or if
1200
- ** the db is a temp-db, it is a no-op, not an error.
1198
+ ** database is not a temp db, then the [SQLITE_FCNTL_RESET_CACHE] file-control
1199
+ ** purges the contents of the in-memory page cache. If there is an open
1200
+ ** transaction, or if the db is a temp-db, this opcode is a no-op, not an error.
1201
1201
  ** </ul>
1202
1202
  */
1203
1203
  #define SQLITE_FCNTL_LOCKSTATE 1
@@ -1655,20 +1655,23 @@ SQLITE_API int sqlite3_os_end(void);
1655
1655
  ** must ensure that no other SQLite interfaces are invoked by other
1656
1656
  ** threads while sqlite3_config() is running.</b>
1657
1657
  **
1658
- ** The sqlite3_config() interface
1659
- ** may only be invoked prior to library initialization using
1660
- ** [sqlite3_initialize()] or after shutdown by [sqlite3_shutdown()].
1661
- ** ^If sqlite3_config() is called after [sqlite3_initialize()] and before
1662
- ** [sqlite3_shutdown()] then it will return SQLITE_MISUSE.
1663
- ** Note, however, that ^sqlite3_config() can be called as part of the
1664
- ** implementation of an application-defined [sqlite3_os_init()].
1665
- **
1666
1658
  ** The first argument to sqlite3_config() is an integer
1667
1659
  ** [configuration option] that determines
1668
1660
  ** what property of SQLite is to be configured. Subsequent arguments
1669
1661
  ** vary depending on the [configuration option]
1670
1662
  ** in the first argument.
1671
1663
  **
1664
+ ** For most configuration options, the sqlite3_config() interface
1665
+ ** may only be invoked prior to library initialization using
1666
+ ** [sqlite3_initialize()] or after shutdown by [sqlite3_shutdown()].
1667
+ ** The exceptional configuration options that may be invoked at any time
1668
+ ** are called "anytime configuration options".
1669
+ ** ^If sqlite3_config() is called after [sqlite3_initialize()] and before
1670
+ ** [sqlite3_shutdown()] with a first argument that is not an anytime
1671
+ ** configuration option, then the sqlite3_config() call will return SQLITE_MISUSE.
1672
+ ** Note, however, that ^sqlite3_config() can be called as part of the
1673
+ ** implementation of an application-defined [sqlite3_os_init()].
1674
+ **
1672
1675
  ** ^When a configuration option is set, sqlite3_config() returns [SQLITE_OK].
1673
1676
  ** ^If the option is unknown or SQLite is unable to set the option
1674
1677
  ** then this routine returns a non-zero [error code].
@@ -1776,6 +1779,23 @@ struct sqlite3_mem_methods {
1776
1779
  ** These constants are the available integer configuration options that
1777
1780
  ** can be passed as the first argument to the [sqlite3_config()] interface.
1778
1781
  **
1782
+ ** Most of the configuration options for sqlite3_config()
1783
+ ** will only work if invoked prior to [sqlite3_initialize()] or after
1784
+ ** [sqlite3_shutdown()]. The few exceptions to this rule are called
1785
+ ** "anytime configuration options".
1786
+ ** ^Calling [sqlite3_config()] with a first argument that is not an
1787
+ ** anytime configuration option in between calls to [sqlite3_initialize()] and
1788
+ ** [sqlite3_shutdown()] is a no-op that returns SQLITE_MISUSE.
1789
+ **
1790
+ ** The set of anytime configuration options can change (by insertions
1791
+ ** and/or deletions) from one release of SQLite to the next.
1792
+ ** As of SQLite version 3.42.0, the complete set of anytime configuration
1793
+ ** options is:
1794
+ ** <ul>
1795
+ ** <li> SQLITE_CONFIG_LOG
1796
+ ** <li> SQLITE_CONFIG_PCACHE_HDRSZ
1797
+ ** </ul>
1798
+ **
1779
1799
  ** New configuration options may be added in future releases of SQLite.
1780
1800
  ** Existing configuration options might be discontinued. Applications
1781
1801
  ** should check the return code from [sqlite3_config()] to make sure that
@@ -2122,28 +2142,28 @@ struct sqlite3_mem_methods {
2122
2142
  ** compile-time option is not set, then the default maximum is 1073741824.
2123
2143
  ** </dl>
2124
2144
  */
2125
- #define SQLITE_CONFIG_SINGLETHREAD 1 /* nil */
2126
- #define SQLITE_CONFIG_MULTITHREAD 2 /* nil */
2127
- #define SQLITE_CONFIG_SERIALIZED 3 /* nil */
2128
- #define SQLITE_CONFIG_MALLOC 4 /* sqlite3_mem_methods* */
2129
- #define SQLITE_CONFIG_GETMALLOC 5 /* sqlite3_mem_methods* */
2130
- #define SQLITE_CONFIG_SCRATCH 6 /* No longer used */
2131
- #define SQLITE_CONFIG_PAGECACHE 7 /* void*, int sz, int N */
2132
- #define SQLITE_CONFIG_HEAP 8 /* void*, int nByte, int min */
2133
- #define SQLITE_CONFIG_MEMSTATUS 9 /* boolean */
2134
- #define SQLITE_CONFIG_MUTEX 10 /* sqlite3_mutex_methods* */
2135
- #define SQLITE_CONFIG_GETMUTEX 11 /* sqlite3_mutex_methods* */
2136
- /* previously SQLITE_CONFIG_CHUNKALLOC 12 which is now unused. */
2137
- #define SQLITE_CONFIG_LOOKASIDE 13 /* int int */
2138
- #define SQLITE_CONFIG_PCACHE 14 /* no-op */
2139
- #define SQLITE_CONFIG_GETPCACHE 15 /* no-op */
2140
- #define SQLITE_CONFIG_LOG 16 /* xFunc, void* */
2141
- #define SQLITE_CONFIG_URI 17 /* int */
2142
- #define SQLITE_CONFIG_PCACHE2 18 /* sqlite3_pcache_methods2* */
2143
- #define SQLITE_CONFIG_GETPCACHE2 19 /* sqlite3_pcache_methods2* */
2145
+ #define SQLITE_CONFIG_SINGLETHREAD 1 /* nil */
2146
+ #define SQLITE_CONFIG_MULTITHREAD 2 /* nil */
2147
+ #define SQLITE_CONFIG_SERIALIZED 3 /* nil */
2148
+ #define SQLITE_CONFIG_MALLOC 4 /* sqlite3_mem_methods* */
2149
+ #define SQLITE_CONFIG_GETMALLOC 5 /* sqlite3_mem_methods* */
2150
+ #define SQLITE_CONFIG_SCRATCH 6 /* No longer used */
2151
+ #define SQLITE_CONFIG_PAGECACHE 7 /* void*, int sz, int N */
2152
+ #define SQLITE_CONFIG_HEAP 8 /* void*, int nByte, int min */
2153
+ #define SQLITE_CONFIG_MEMSTATUS 9 /* boolean */
2154
+ #define SQLITE_CONFIG_MUTEX 10 /* sqlite3_mutex_methods* */
2155
+ #define SQLITE_CONFIG_GETMUTEX 11 /* sqlite3_mutex_methods* */
2156
+ /* previously SQLITE_CONFIG_CHUNKALLOC 12 which is now unused. */
2157
+ #define SQLITE_CONFIG_LOOKASIDE 13 /* int int */
2158
+ #define SQLITE_CONFIG_PCACHE 14 /* no-op */
2159
+ #define SQLITE_CONFIG_GETPCACHE 15 /* no-op */
2160
+ #define SQLITE_CONFIG_LOG 16 /* xFunc, void* */
2161
+ #define SQLITE_CONFIG_URI 17 /* int */
2162
+ #define SQLITE_CONFIG_PCACHE2 18 /* sqlite3_pcache_methods2* */
2163
+ #define SQLITE_CONFIG_GETPCACHE2 19 /* sqlite3_pcache_methods2* */
2144
2164
  #define SQLITE_CONFIG_COVERING_INDEX_SCAN 20 /* int */
2145
- #define SQLITE_CONFIG_SQLLOG 21 /* xSqllog, void* */
2146
- #define SQLITE_CONFIG_MMAP_SIZE 22 /* sqlite3_int64, sqlite3_int64 */
2165
+ #define SQLITE_CONFIG_SQLLOG 21 /* xSqllog, void* */
2166
+ #define SQLITE_CONFIG_MMAP_SIZE 22 /* sqlite3_int64, sqlite3_int64 */
2147
2167
  #define SQLITE_CONFIG_WIN32_HEAPSIZE 23 /* int nByte */
2148
2168
  #define SQLITE_CONFIG_PCACHE_HDRSZ 24 /* int *psz */
2149
2169
  #define SQLITE_CONFIG_PMASZ 25 /* unsigned int szPma */
@@ -2184,7 +2204,7 @@ struct sqlite3_mem_methods {
2184
2204
  ** configuration for a database connection can only be changed when that
2185
2205
  ** connection is not currently using lookaside memory, or in other words
2186
2206
  ** when the "current value" returned by
2187
- ** [sqlite3_db_status](D,[SQLITE_CONFIG_LOOKASIDE],...) is zero.
2207
+ ** [sqlite3_db_status](D,[SQLITE_DBSTATUS_LOOKASIDE_USED],...) is zero.
2188
2208
  ** Any attempt to change the lookaside memory configuration when lookaside
2189
2209
  ** memory is in use leaves the configuration unchanged and returns
2190
2210
  ** [SQLITE_BUSY].)^</dd>
@@ -2334,8 +2354,12 @@ struct sqlite3_mem_methods {
2334
2354
  ** <li> sqlite3_db_config(db, SQLITE_DBCONFIG_RESET_DATABASE, 0, 0);
2335
2355
  ** </ol>
2336
2356
  ** Because resetting a database is destructive and irreversible, the
2337
- ** process requires the use of this obscure API and multiple steps to help
2338
- ** ensure that it does not happen by accident.
2357
+ ** process requires the use of this obscure API and multiple steps to
2358
+ ** help ensure that it does not happen by accident. Because this
2359
+ ** feature must be capable of resetting corrupt databases, and
2360
+ ** shutting down virtual tables may require access to that corrupt
2361
+ ** storage, the library must abandon any installed virtual tables
2362
+ ** without calling their xDestroy() methods.
2339
2363
  **
2340
2364
  ** [[SQLITE_DBCONFIG_DEFENSIVE]] <dt>SQLITE_DBCONFIG_DEFENSIVE</dt>
2341
2365
  ** <dd>The SQLITE_DBCONFIG_DEFENSIVE option activates or deactivates the
@@ -2374,7 +2398,7 @@ struct sqlite3_mem_methods {
2374
2398
  ** </dd>
2375
2399
  **
2376
2400
  ** [[SQLITE_DBCONFIG_DQS_DML]]
2377
- ** <dt>SQLITE_DBCONFIG_DQS_DML</td>
2401
+ ** <dt>SQLITE_DBCONFIG_DQS_DML</dt>
2378
2402
  ** <dd>The SQLITE_DBCONFIG_DQS_DML option activates or deactivates
2379
2403
  ** the legacy [double-quoted string literal] misfeature for DML statements
2380
2404
  ** only, that is DELETE, INSERT, SELECT, and UPDATE statements. The
@@ -2383,7 +2407,7 @@ struct sqlite3_mem_methods {
2383
2407
  ** </dd>
2384
2408
  **
2385
2409
  ** [[SQLITE_DBCONFIG_DQS_DDL]]
2386
- ** <dt>SQLITE_DBCONFIG_DQS_DDL</td>
2410
+ ** <dt>SQLITE_DBCONFIG_DQS_DDL</dt>
2387
2411
  ** <dd>The SQLITE_DBCONFIG_DQS option activates or deactivates
2388
2412
  ** the legacy [double-quoted string literal] misfeature for DDL statements,
2389
2413
  ** such as CREATE TABLE and CREATE INDEX. The
@@ -2392,7 +2416,7 @@ struct sqlite3_mem_methods {
2392
2416
  ** </dd>
2393
2417
  **
2394
2418
  ** [[SQLITE_DBCONFIG_TRUSTED_SCHEMA]]
2395
- ** <dt>SQLITE_DBCONFIG_TRUSTED_SCHEMA</td>
2419
+ ** <dt>SQLITE_DBCONFIG_TRUSTED_SCHEMA</dt>
2396
2420
  ** <dd>The SQLITE_DBCONFIG_TRUSTED_SCHEMA option tells SQLite to
2397
2421
  ** assume that database schemas are untainted by malicious content.
2398
2422
  ** When the SQLITE_DBCONFIG_TRUSTED_SCHEMA option is disabled, SQLite
@@ -2412,7 +2436,7 @@ struct sqlite3_mem_methods {
2412
2436
  ** </dd>
2413
2437
  **
2414
2438
  ** [[SQLITE_DBCONFIG_LEGACY_FILE_FORMAT]]
2415
- ** <dt>SQLITE_DBCONFIG_LEGACY_FILE_FORMAT</td>
2439
+ ** <dt>SQLITE_DBCONFIG_LEGACY_FILE_FORMAT</dt>
2416
2440
  ** <dd>The SQLITE_DBCONFIG_LEGACY_FILE_FORMAT option activates or deactivates
2417
2441
  ** the legacy file format flag. When activated, this flag causes all newly
2418
2442
  ** created database file to have a schema format version number (the 4-byte
@@ -2421,7 +2445,7 @@ struct sqlite3_mem_methods {
2421
2445
  ** any SQLite version back to 3.0.0 ([dateof:3.0.0]). Without this setting,
2422
2446
  ** newly created databases are generally not understandable by SQLite versions
2423
2447
  ** prior to 3.3.0 ([dateof:3.3.0]). As these words are written, there
2424
- ** is now scarcely any need to generated database files that are compatible
2448
+ ** is now scarcely any need to generate database files that are compatible
2425
2449
  ** all the way back to version 3.0.0, and so this setting is of little
2426
2450
  ** practical use, but is provided so that SQLite can continue to claim the
2427
2451
  ** ability to generate new database files that are compatible with version
@@ -2432,6 +2456,38 @@ struct sqlite3_mem_methods {
2432
2456
  ** not considered a bug since SQLite versions 3.3.0 and earlier do not support
2433
2457
  ** either generated columns or decending indexes.
2434
2458
  ** </dd>
2459
+ **
2460
+ ** [[SQLITE_DBCONFIG_STMT_SCANSTATUS]]
2461
+ ** <dt>SQLITE_DBCONFIG_STMT_SCANSTATUS</dt>
2462
+ ** <dd>The SQLITE_DBCONFIG_STMT_SCANSTATUS option is only useful in
2463
+ ** SQLITE_ENABLE_STMT_SCANSTATUS builds. In this case, it sets or clears
2464
+ ** a flag that enables collection of the sqlite3_stmt_scanstatus_v2()
2465
+ ** statistics. For statistics to be collected, the flag must be set on
2466
+ ** the database handle both when the SQL statement is prepared and when it
2467
+ ** is stepped. The flag is set (collection of statistics is enabled)
2468
+ ** by default. This option takes two arguments: an integer and a pointer to
2469
+ ** an integer.. The first argument is 1, 0, or -1 to enable, disable, or
2470
+ ** leave unchanged the statement scanstatus option. If the second argument
2471
+ ** is not NULL, then the value of the statement scanstatus setting after
2472
+ ** processing the first argument is written into the integer that the second
2473
+ ** argument points to.
2474
+ ** </dd>
2475
+ **
2476
+ ** [[SQLITE_DBCONFIG_REVERSE_SCANORDER]]
2477
+ ** <dt>SQLITE_DBCONFIG_REVERSE_SCANORDER</dt>
2478
+ ** <dd>The SQLITE_DBCONFIG_REVERSE_SCANORDER option changes the default order
2479
+ ** in which tables and indexes are scanned so that the scans start at the end
2480
+ ** and work toward the beginning rather than starting at the beginning and
2481
+ ** working toward the end. Setting SQLITE_DBCONFIG_REVERSE_SCANORDER is the
2482
+ ** same as setting [PRAGMA reverse_unordered_selects]. This option takes
2483
+ ** two arguments which are an integer and a pointer to an integer. The first
2484
+ ** argument is 1, 0, or -1 to enable, disable, or leave unchanged the
2485
+ ** reverse scan order flag, respectively. If the second argument is not NULL,
2486
+ ** then 0 or 1 is written into the integer that the second argument points to
2487
+ ** depending on if the reverse scan order flag is set after processing the
2488
+ ** first argument.
2489
+ ** </dd>
2490
+ **
2435
2491
  ** </dl>
2436
2492
  */
2437
2493
  #define SQLITE_DBCONFIG_MAINDBNAME 1000 /* const char* */
@@ -2452,7 +2508,9 @@ struct sqlite3_mem_methods {
2452
2508
  #define SQLITE_DBCONFIG_ENABLE_VIEW 1015 /* int int* */
2453
2509
  #define SQLITE_DBCONFIG_LEGACY_FILE_FORMAT 1016 /* int int* */
2454
2510
  #define SQLITE_DBCONFIG_TRUSTED_SCHEMA 1017 /* int int* */
2455
- #define SQLITE_DBCONFIG_MAX 1017 /* Largest DBCONFIG */
2511
+ #define SQLITE_DBCONFIG_STMT_SCANSTATUS 1018 /* int int* */
2512
+ #define SQLITE_DBCONFIG_REVERSE_SCANORDER 1019 /* int int* */
2513
+ #define SQLITE_DBCONFIG_MAX 1019 /* Largest DBCONFIG */
2456
2514
 
2457
2515
  /*
2458
2516
  ** CAPI3REF: Enable Or Disable Extended Result Codes
@@ -2674,8 +2732,12 @@ SQLITE_API sqlite3_int64 sqlite3_total_changes64(sqlite3*);
2674
2732
  ** ^A call to sqlite3_interrupt(D) that occurs when there are no running
2675
2733
  ** SQL statements is a no-op and has no effect on SQL statements
2676
2734
  ** that are started after the sqlite3_interrupt() call returns.
2735
+ **
2736
+ ** ^The [sqlite3_is_interrupted(D)] interface can be used to determine whether
2737
+ ** or not an interrupt is currently in effect for [database connection] D.
2677
2738
  */
2678
2739
  SQLITE_API void sqlite3_interrupt(sqlite3*);
2740
+ SQLITE_API int sqlite3_is_interrupted(sqlite3*);
2679
2741
 
2680
2742
  /*
2681
2743
  ** CAPI3REF: Determine If An SQL Statement Is Complete
@@ -3293,8 +3355,8 @@ SQLITE_API SQLITE_DEPRECATED void *sqlite3_profile(sqlite3*,
3293
3355
  ** <dd>^An SQLITE_TRACE_PROFILE callback provides approximately the same
3294
3356
  ** information as is provided by the [sqlite3_profile()] callback.
3295
3357
  ** ^The P argument is a pointer to the [prepared statement] and the
3296
- ** X argument points to a 64-bit integer which is the estimated of
3297
- ** the number of nanosecond that the prepared statement took to run.
3358
+ ** X argument points to a 64-bit integer which is approximately
3359
+ ** the number of nanoseconds that the prepared statement took to run.
3298
3360
  ** ^The SQLITE_TRACE_PROFILE callback is invoked when the statement finishes.
3299
3361
  **
3300
3362
  ** [[SQLITE_TRACE_ROW]] <dt>SQLITE_TRACE_ROW</dt>
@@ -3357,7 +3419,7 @@ SQLITE_API int sqlite3_trace_v2(
3357
3419
  **
3358
3420
  ** ^The sqlite3_progress_handler(D,N,X,P) interface causes the callback
3359
3421
  ** function X to be invoked periodically during long running calls to
3360
- ** [sqlite3_exec()], [sqlite3_step()] and [sqlite3_get_table()] for
3422
+ ** [sqlite3_step()] and [sqlite3_prepare()] and similar for
3361
3423
  ** database connection D. An example use for this
3362
3424
  ** interface is to keep a GUI updated during a large query.
3363
3425
  **
@@ -3382,6 +3444,13 @@ SQLITE_API int sqlite3_trace_v2(
3382
3444
  ** Note that [sqlite3_prepare_v2()] and [sqlite3_step()] both modify their
3383
3445
  ** database connections for the meaning of "modify" in this paragraph.
3384
3446
  **
3447
+ ** The progress handler callback would originally only be invoked from the
3448
+ ** bytecode engine. It still might be invoked during [sqlite3_prepare()]
3449
+ ** and similar because those routines might force a reparse of the schema
3450
+ ** which involves running the bytecode engine. However, beginning with
3451
+ ** SQLite version 3.41.0, the progress handler callback might also be
3452
+ ** invoked directly from [sqlite3_prepare()] while analyzing and generating
3453
+ ** code for complex queries.
3385
3454
  */
3386
3455
  SQLITE_API void sqlite3_progress_handler(sqlite3*, int, int(*)(void*), void*);
3387
3456
 
@@ -3418,13 +3487,18 @@ SQLITE_API void sqlite3_progress_handler(sqlite3*, int, int(*)(void*), void*);
3418
3487
  **
3419
3488
  ** <dl>
3420
3489
  ** ^(<dt>[SQLITE_OPEN_READONLY]</dt>
3421
- ** <dd>The database is opened in read-only mode. If the database does not
3422
- ** already exist, an error is returned.</dd>)^
3490
+ ** <dd>The database is opened in read-only mode. If the database does
3491
+ ** not already exist, an error is returned.</dd>)^
3423
3492
  **
3424
3493
  ** ^(<dt>[SQLITE_OPEN_READWRITE]</dt>
3425
- ** <dd>The database is opened for reading and writing if possible, or reading
3426
- ** only if the file is write protected by the operating system. In either
3427
- ** case the database must already exist, otherwise an error is returned.</dd>)^
3494
+ ** <dd>The database is opened for reading and writing if possible, or
3495
+ ** reading only if the file is write protected by the operating
3496
+ ** system. In either case the database must already exist, otherwise
3497
+ ** an error is returned. For historical reasons, if opening in
3498
+ ** read-write mode fails due to OS-level permissions, an attempt is
3499
+ ** made to open it in read-only mode. [sqlite3_db_readonly()] can be
3500
+ ** used to determine whether the database is actually
3501
+ ** read-write.</dd>)^
3428
3502
  **
3429
3503
  ** ^(<dt>[SQLITE_OPEN_READWRITE] | [SQLITE_OPEN_CREATE]</dt>
3430
3504
  ** <dd>The database is opened for reading and writing, and is created if
@@ -5405,10 +5479,21 @@ SQLITE_API int sqlite3_create_window_function(
5405
5479
  ** from top-level SQL, and cannot be used in VIEWs or TRIGGERs nor in
5406
5480
  ** schema structures such as [CHECK constraints], [DEFAULT clauses],
5407
5481
  ** [expression indexes], [partial indexes], or [generated columns].
5408
- ** The SQLITE_DIRECTONLY flags is a security feature which is recommended
5409
- ** for all [application-defined SQL functions], and especially for functions
5410
- ** that have side-effects or that could potentially leak sensitive
5411
- ** information.
5482
+ ** <p>
5483
+ ** The SQLITE_DIRECTONLY flag is recommended for any
5484
+ ** [application-defined SQL function]
5485
+ ** that has side-effects or that could potentially leak sensitive information.
5486
+ ** This will prevent attacks in which an application is tricked
5487
+ ** into using a database file that has had its schema surreptiously
5488
+ ** modified to invoke the application-defined function in ways that are
5489
+ ** harmful.
5490
+ ** <p>
5491
+ ** Some people say it is good practice to set SQLITE_DIRECTONLY on all
5492
+ ** [application-defined SQL functions], regardless of whether or not they
5493
+ ** are security sensitive, as doing so prevents those functions from being used
5494
+ ** inside of the database schema, and thus ensures that the database
5495
+ ** can be inspected and modified using generic tools (such as the [CLI])
5496
+ ** that do not have access to the application-defined functions.
5412
5497
  ** </dd>
5413
5498
  **
5414
5499
  ** [[SQLITE_INNOCUOUS]] <dt>SQLITE_INNOCUOUS</dt><dd>
@@ -5549,16 +5634,6 @@ SQLITE_API SQLITE_DEPRECATED int sqlite3_memory_alarm(void(*)(void*,sqlite3_int6
5549
5634
  ** then the conversion is performed. Otherwise no conversion occurs.
5550
5635
  ** The [SQLITE_INTEGER | datatype] after conversion is returned.)^
5551
5636
  **
5552
- ** ^(The sqlite3_value_encoding(X) interface returns one of [SQLITE_UTF8],
5553
- ** [SQLITE_UTF16BE], or [SQLITE_UTF16LE] according to the current encoding
5554
- ** of the value X, assuming that X has type TEXT.)^ If sqlite3_value_type(X)
5555
- ** returns something other than SQLITE_TEXT, then the return value from
5556
- ** sqlite3_value_encoding(X) is meaningless. ^Calls to
5557
- ** sqlite3_value_text(X), sqlite3_value_text16(X), sqlite3_value_text16be(X),
5558
- ** sqlite3_value_text16le(X), sqlite3_value_bytes(X), or
5559
- ** sqlite3_value_bytes16(X) might change the encoding of the value X and
5560
- ** thus change the return from subsequent calls to sqlite3_value_encoding(X).
5561
- **
5562
5637
  ** ^Within the [xUpdate] method of a [virtual table], the
5563
5638
  ** sqlite3_value_nochange(X) interface returns true if and only if
5564
5639
  ** the column corresponding to X is unchanged by the UPDATE operation
@@ -5623,6 +5698,27 @@ SQLITE_API int sqlite3_value_type(sqlite3_value*);
5623
5698
  SQLITE_API int sqlite3_value_numeric_type(sqlite3_value*);
5624
5699
  SQLITE_API int sqlite3_value_nochange(sqlite3_value*);
5625
5700
  SQLITE_API int sqlite3_value_frombind(sqlite3_value*);
5701
+
5702
+ /*
5703
+ ** CAPI3REF: Report the internal text encoding state of an sqlite3_value object
5704
+ ** METHOD: sqlite3_value
5705
+ **
5706
+ ** ^(The sqlite3_value_encoding(X) interface returns one of [SQLITE_UTF8],
5707
+ ** [SQLITE_UTF16BE], or [SQLITE_UTF16LE] according to the current text encoding
5708
+ ** of the value X, assuming that X has type TEXT.)^ If sqlite3_value_type(X)
5709
+ ** returns something other than SQLITE_TEXT, then the return value from
5710
+ ** sqlite3_value_encoding(X) is meaningless. ^Calls to
5711
+ ** [sqlite3_value_text(X)], [sqlite3_value_text16(X)], [sqlite3_value_text16be(X)],
5712
+ ** [sqlite3_value_text16le(X)], [sqlite3_value_bytes(X)], or
5713
+ ** [sqlite3_value_bytes16(X)] might change the encoding of the value X and
5714
+ ** thus change the return from subsequent calls to sqlite3_value_encoding(X).
5715
+ **
5716
+ ** This routine is intended for used by applications that test and validate
5717
+ ** the SQLite implementation. This routine is inquiring about the opaque
5718
+ ** internal state of an [sqlite3_value] object. Ordinary applications should
5719
+ ** not need to know what the internal state of an sqlite3_value object is and
5720
+ ** hence should not need to use this interface.
5721
+ */
5626
5722
  SQLITE_API int sqlite3_value_encoding(sqlite3_value*);
5627
5723
 
5628
5724
  /*
@@ -6159,6 +6255,13 @@ SQLITE_API void sqlite3_activate_cerod(
6159
6255
  ** of the default VFS is not implemented correctly, or not implemented at
6160
6256
  ** all, then the behavior of sqlite3_sleep() may deviate from the description
6161
6257
  ** in the previous paragraphs.
6258
+ **
6259
+ ** If a negative argument is passed to sqlite3_sleep() the results vary by
6260
+ ** VFS and operating system. Some system treat a negative argument as an
6261
+ ** instruction to sleep forever. Others understand it to mean do not sleep
6262
+ ** at all. ^In SQLite version 3.42.0 and later, a negative
6263
+ ** argument passed into sqlite3_sleep() is changed to zero before it is relayed
6264
+ ** down into the xSleep method of the VFS.
6162
6265
  */
6163
6266
  SQLITE_API int sqlite3_sleep(int);
6164
6267
 
@@ -7003,15 +7106,6 @@ SQLITE_API int sqlite3_cancel_auto_extension(void(*xEntryPoint)(void));
7003
7106
  */
7004
7107
  SQLITE_API void sqlite3_reset_auto_extension(void);
7005
7108
 
7006
- /*
7007
- ** The interface to the virtual-table mechanism is currently considered
7008
- ** to be experimental. The interface might change in incompatible ways.
7009
- ** If this is a problem for you, do not use the interface at this time.
7010
- **
7011
- ** When the virtual-table mechanism stabilizes, we will declare the
7012
- ** interface fixed, support it indefinitely, and remove this comment.
7013
- */
7014
-
7015
7109
  /*
7016
7110
  ** Structures used by the virtual table interface
7017
7111
  */
@@ -7130,10 +7224,10 @@ struct sqlite3_module {
7130
7224
  ** when the omit flag is true there is no guarantee that the constraint will
7131
7225
  ** not be checked again using byte code.)^
7132
7226
  **
7133
- ** ^The idxNum and idxPtr values are recorded and passed into the
7227
+ ** ^The idxNum and idxStr values are recorded and passed into the
7134
7228
  ** [xFilter] method.
7135
- ** ^[sqlite3_free()] is used to free idxPtr if and only if
7136
- ** needToFreeIdxPtr is true.
7229
+ ** ^[sqlite3_free()] is used to free idxStr if and only if
7230
+ ** needToFreeIdxStr is true.
7137
7231
  **
7138
7232
  ** ^The orderByConsumed means that output from [xFilter]/[xNext] will occur in
7139
7233
  ** the correct order to satisfy the ORDER BY clause so that no separate
@@ -7253,7 +7347,7 @@ struct sqlite3_index_info {
7253
7347
  ** the [sqlite3_vtab_collation()] interface. For most real-world virtual
7254
7348
  ** tables, the collating sequence of constraints does not matter (for example
7255
7349
  ** because the constraints are numeric) and so the sqlite3_vtab_collation()
7256
- ** interface is no commonly needed.
7350
+ ** interface is not commonly needed.
7257
7351
  */
7258
7352
  #define SQLITE_INDEX_CONSTRAINT_EQ 2
7259
7353
  #define SQLITE_INDEX_CONSTRAINT_GT 4
@@ -7412,16 +7506,6 @@ SQLITE_API int sqlite3_declare_vtab(sqlite3*, const char *zSQL);
7412
7506
  */
7413
7507
  SQLITE_API int sqlite3_overload_function(sqlite3*, const char *zFuncName, int nArg);
7414
7508
 
7415
- /*
7416
- ** The interface to the virtual-table mechanism defined above (back up
7417
- ** to a comment remarkably similar to this one) is currently considered
7418
- ** to be experimental. The interface might change in incompatible ways.
7419
- ** If this is a problem for you, do not use the interface at this time.
7420
- **
7421
- ** When the virtual-table mechanism stabilizes, we will declare the
7422
- ** interface fixed, support it indefinitely, and remove this comment.
7423
- */
7424
-
7425
7509
  /*
7426
7510
  ** CAPI3REF: A Handle To An Open BLOB
7427
7511
  ** KEYWORDS: {BLOB handle} {BLOB handles}
@@ -7805,9 +7889,9 @@ SQLITE_API int sqlite3_vfs_unregister(sqlite3_vfs*);
7805
7889
  ** is undefined if the mutex is not currently entered by the
7806
7890
  ** calling thread or is not currently allocated.
7807
7891
  **
7808
- ** ^If the argument to sqlite3_mutex_enter(), sqlite3_mutex_try(), or
7809
- ** sqlite3_mutex_leave() is a NULL pointer, then all three routines
7810
- ** behave as no-ops.
7892
+ ** ^If the argument to sqlite3_mutex_enter(), sqlite3_mutex_try(),
7893
+ ** sqlite3_mutex_leave(), or sqlite3_mutex_free() is a NULL pointer,
7894
+ ** then any of the four routines behaves as a no-op.
7811
7895
  **
7812
7896
  ** See also: [sqlite3_mutex_held()] and [sqlite3_mutex_notheld()].
7813
7897
  */
@@ -9541,18 +9625,28 @@ SQLITE_API int sqlite3_vtab_config(sqlite3*, int op, ...);
9541
9625
  ** [[SQLITE_VTAB_INNOCUOUS]]<dt>SQLITE_VTAB_INNOCUOUS</dt>
9542
9626
  ** <dd>Calls of the form
9543
9627
  ** [sqlite3_vtab_config](db,SQLITE_VTAB_INNOCUOUS) from within the
9544
- ** the [xConnect] or [xCreate] methods of a [virtual table] implmentation
9628
+ ** the [xConnect] or [xCreate] methods of a [virtual table] implementation
9545
9629
  ** identify that virtual table as being safe to use from within triggers
9546
9630
  ** and views. Conceptually, the SQLITE_VTAB_INNOCUOUS tag means that the
9547
9631
  ** virtual table can do no serious harm even if it is controlled by a
9548
9632
  ** malicious hacker. Developers should avoid setting the SQLITE_VTAB_INNOCUOUS
9549
9633
  ** flag unless absolutely necessary.
9550
9634
  ** </dd>
9635
+ **
9636
+ ** [[SQLITE_VTAB_USES_ALL_SCHEMAS]]<dt>SQLITE_VTAB_USES_ALL_SCHEMAS</dt>
9637
+ ** <dd>Calls of the form
9638
+ ** [sqlite3_vtab_config](db,SQLITE_VTAB_USES_ALL_SCHEMA) from within the
9639
+ ** the [xConnect] or [xCreate] methods of a [virtual table] implementation
9640
+ ** instruct the query planner to begin at least a read transaction on
9641
+ ** all schemas ("main", "temp", and any ATTACH-ed databases) whenever the
9642
+ ** virtual table is used.
9643
+ ** </dd>
9551
9644
  ** </dl>
9552
9645
  */
9553
9646
  #define SQLITE_VTAB_CONSTRAINT_SUPPORT 1
9554
9647
  #define SQLITE_VTAB_INNOCUOUS 2
9555
9648
  #define SQLITE_VTAB_DIRECTONLY 3
9649
+ #define SQLITE_VTAB_USES_ALL_SCHEMAS 4
9556
9650
 
9557
9651
  /*
9558
9652
  ** CAPI3REF: Determine The Virtual Table Conflict Policy
@@ -9625,7 +9719,7 @@ SQLITE_API int sqlite3_vtab_nochange(sqlite3_context*);
9625
9719
  ** <li><p> Otherwise, "BINARY" is returned.
9626
9720
  ** </ol>
9627
9721
  */
9628
- SQLITE_API SQLITE_EXPERIMENTAL const char *sqlite3_vtab_collation(sqlite3_index_info*,int);
9722
+ SQLITE_API const char *sqlite3_vtab_collation(sqlite3_index_info*,int);
9629
9723
 
9630
9724
  /*
9631
9725
  ** CAPI3REF: Determine if a virtual table query is DISTINCT
@@ -9782,21 +9876,20 @@ SQLITE_API int sqlite3_vtab_in(sqlite3_index_info*, int iCons, int bHandle);
9782
9876
  ** is undefined and probably harmful.
9783
9877
  **
9784
9878
  ** The X parameter in a call to sqlite3_vtab_in_first(X,P) or
9785
- ** sqlite3_vtab_in_next(X,P) must be one of the parameters to the
9879
+ ** sqlite3_vtab_in_next(X,P) should be one of the parameters to the
9786
9880
  ** xFilter method which invokes these routines, and specifically
9787
9881
  ** a parameter that was previously selected for all-at-once IN constraint
9788
9882
  ** processing use the [sqlite3_vtab_in()] interface in the
9789
9883
  ** [xBestIndex|xBestIndex method]. ^(If the X parameter is not
9790
9884
  ** an xFilter argument that was selected for all-at-once IN constraint
9791
- ** processing, then these routines return [SQLITE_MISUSE])^ or perhaps
9792
- ** exhibit some other undefined or harmful behavior.
9885
+ ** processing, then these routines return [SQLITE_ERROR].)^
9793
9886
  **
9794
9887
  ** ^(Use these routines to access all values on the right-hand side
9795
9888
  ** of the IN constraint using code like the following:
9796
9889
  **
9797
9890
  ** <blockquote><pre>
9798
9891
  ** &nbsp; for(rc=sqlite3_vtab_in_first(pList, &pVal);
9799
- ** &nbsp; rc==SQLITE_OK && pVal
9892
+ ** &nbsp; rc==SQLITE_OK && pVal;
9800
9893
  ** &nbsp; rc=sqlite3_vtab_in_next(pList, &pVal)
9801
9894
  ** &nbsp; ){
9802
9895
  ** &nbsp; // do something with pVal
@@ -9894,6 +9987,10 @@ SQLITE_API int sqlite3_vtab_rhs_value(sqlite3_index_info*, int, sqlite3_value **
9894
9987
  ** managed by the prepared statement S and will be automatically freed when
9895
9988
  ** S is finalized.
9896
9989
  **
9990
+ ** Not all values are available for all query elements. When a value is
9991
+ ** not available, the output variable is set to -1 if the value is numeric,
9992
+ ** or to NULL if it is a string (SQLITE_SCANSTAT_NAME).
9993
+ **
9897
9994
  ** <dl>
9898
9995
  ** [[SQLITE_SCANSTAT_NLOOP]] <dt>SQLITE_SCANSTAT_NLOOP</dt>
9899
9996
  ** <dd>^The [sqlite3_int64] variable pointed to by the V parameter will be
@@ -9921,12 +10018,24 @@ SQLITE_API int sqlite3_vtab_rhs_value(sqlite3_index_info*, int, sqlite3_value **
9921
10018
  ** to a zero-terminated UTF-8 string containing the [EXPLAIN QUERY PLAN]
9922
10019
  ** description for the X-th loop.
9923
10020
  **
9924
- ** [[SQLITE_SCANSTAT_SELECTID]] <dt>SQLITE_SCANSTAT_SELECT</dt>
10021
+ ** [[SQLITE_SCANSTAT_SELECTID]] <dt>SQLITE_SCANSTAT_SELECTID</dt>
9925
10022
  ** <dd>^The "int" variable pointed to by the V parameter will be set to the
9926
- ** "select-id" for the X-th loop. The select-id identifies which query or
9927
- ** subquery the loop is part of. The main query has a select-id of zero.
9928
- ** The select-id is the same value as is output in the first column
9929
- ** of an [EXPLAIN QUERY PLAN] query.
10023
+ ** id for the X-th query plan element. The id value is unique within the
10024
+ ** statement. The select-id is the same value as is output in the first
10025
+ ** column of an [EXPLAIN QUERY PLAN] query.
10026
+ **
10027
+ ** [[SQLITE_SCANSTAT_PARENTID]] <dt>SQLITE_SCANSTAT_PARENTID</dt>
10028
+ ** <dd>The "int" variable pointed to by the V parameter will be set to the
10029
+ ** the id of the parent of the current query element, if applicable, or
10030
+ ** to zero if the query element has no parent. This is the same value as
10031
+ ** returned in the second column of an [EXPLAIN QUERY PLAN] query.
10032
+ **
10033
+ ** [[SQLITE_SCANSTAT_NCYCLE]] <dt>SQLITE_SCANSTAT_NCYCLE</dt>
10034
+ ** <dd>The sqlite3_int64 output value is set to the number of cycles,
10035
+ ** according to the processor time-stamp counter, that elapsed while the
10036
+ ** query element was being processed. This value is not available for
10037
+ ** all query elements - if it is unavailable the output variable is
10038
+ ** set to -1.
9930
10039
  ** </dl>
9931
10040
  */
9932
10041
  #define SQLITE_SCANSTAT_NLOOP 0
@@ -9935,12 +10044,14 @@ SQLITE_API int sqlite3_vtab_rhs_value(sqlite3_index_info*, int, sqlite3_value **
9935
10044
  #define SQLITE_SCANSTAT_NAME 3
9936
10045
  #define SQLITE_SCANSTAT_EXPLAIN 4
9937
10046
  #define SQLITE_SCANSTAT_SELECTID 5
10047
+ #define SQLITE_SCANSTAT_PARENTID 6
10048
+ #define SQLITE_SCANSTAT_NCYCLE 7
9938
10049
 
9939
10050
  /*
9940
10051
  ** CAPI3REF: Prepared Statement Scan Status
9941
10052
  ** METHOD: sqlite3_stmt
9942
10053
  **
9943
- ** This interface returns information about the predicted and measured
10054
+ ** These interfaces return information about the predicted and measured
9944
10055
  ** performance for pStmt. Advanced applications can use this
9945
10056
  ** interface to compare the predicted and the measured performance and
9946
10057
  ** issue warnings and/or rerun [ANALYZE] if discrepancies are found.
@@ -9951,19 +10062,25 @@ SQLITE_API int sqlite3_vtab_rhs_value(sqlite3_index_info*, int, sqlite3_value **
9951
10062
  **
9952
10063
  ** The "iScanStatusOp" parameter determines which status information to return.
9953
10064
  ** The "iScanStatusOp" must be one of the [scanstatus options] or the behavior
9954
- ** of this interface is undefined.
9955
- ** ^The requested measurement is written into a variable pointed to by
9956
- ** the "pOut" parameter.
9957
- ** Parameter "idx" identifies the specific loop to retrieve statistics for.
9958
- ** Loops are numbered starting from zero. ^If idx is out of range - less than
9959
- ** zero or greater than or equal to the total number of loops used to implement
9960
- ** the statement - a non-zero value is returned and the variable that pOut
9961
- ** points to is unchanged.
9962
- **
9963
- ** ^Statistics might not be available for all loops in all statements. ^In cases
9964
- ** where there exist loops with no available statistics, this function behaves
9965
- ** as if the loop did not exist - it returns non-zero and leave the variable
9966
- ** that pOut points to unchanged.
10065
+ ** of this interface is undefined. ^The requested measurement is written into
10066
+ ** a variable pointed to by the "pOut" parameter.
10067
+ **
10068
+ ** The "flags" parameter must be passed a mask of flags. At present only
10069
+ ** one flag is defined - SQLITE_SCANSTAT_COMPLEX. If SQLITE_SCANSTAT_COMPLEX
10070
+ ** is specified, then status information is available for all elements
10071
+ ** of a query plan that are reported by "EXPLAIN QUERY PLAN" output. If
10072
+ ** SQLITE_SCANSTAT_COMPLEX is not specified, then only query plan elements
10073
+ ** that correspond to query loops (the "SCAN..." and "SEARCH..." elements of
10074
+ ** the EXPLAIN QUERY PLAN output) are available. Invoking API
10075
+ ** sqlite3_stmt_scanstatus() is equivalent to calling
10076
+ ** sqlite3_stmt_scanstatus_v2() with a zeroed flags parameter.
10077
+ **
10078
+ ** Parameter "idx" identifies the specific query element to retrieve statistics
10079
+ ** for. Query elements are numbered starting from zero. A value of -1 may be
10080
+ ** to query for statistics regarding the entire query. ^If idx is out of range
10081
+ ** - less than -1 or greater than or equal to the total number of query
10082
+ ** elements used to implement the statement - a non-zero value is returned and
10083
+ ** the variable that pOut points to is unchanged.
9967
10084
  **
9968
10085
  ** See also: [sqlite3_stmt_scanstatus_reset()]
9969
10086
  */
@@ -9973,6 +10090,19 @@ SQLITE_API int sqlite3_stmt_scanstatus(
9973
10090
  int iScanStatusOp, /* Information desired. SQLITE_SCANSTAT_* */
9974
10091
  void *pOut /* Result written here */
9975
10092
  );
10093
+ SQLITE_API int sqlite3_stmt_scanstatus_v2(
10094
+ sqlite3_stmt *pStmt, /* Prepared statement for which info desired */
10095
+ int idx, /* Index of loop to report on */
10096
+ int iScanStatusOp, /* Information desired. SQLITE_SCANSTAT_* */
10097
+ int flags, /* Mask of flags defined below */
10098
+ void *pOut /* Result written here */
10099
+ );
10100
+
10101
+ /*
10102
+ ** CAPI3REF: Prepared Statement Scan Status
10103
+ ** KEYWORDS: {scan status flags}
10104
+ */
10105
+ #define SQLITE_SCANSTAT_COMPLEX 0x0001
9976
10106
 
9977
10107
  /*
9978
10108
  ** CAPI3REF: Zero Scan-Status Counters
@@ -10063,6 +10193,10 @@ SQLITE_API int sqlite3_db_cacheflush(sqlite3*);
10063
10193
  ** function is not defined for operations on WITHOUT ROWID tables, or for
10064
10194
  ** DELETE operations on rowid tables.
10065
10195
  **
10196
+ ** ^The sqlite3_preupdate_hook(D,C,P) function returns the P argument from
10197
+ ** the previous call on the same [database connection] D, or NULL for
10198
+ ** the first call on D.
10199
+ **
10066
10200
  ** The [sqlite3_preupdate_old()], [sqlite3_preupdate_new()],
10067
10201
  ** [sqlite3_preupdate_count()], and [sqlite3_preupdate_depth()] interfaces
10068
10202
  ** provide additional information about a preupdate event. These routines
@@ -10468,6 +10602,19 @@ SQLITE_API int sqlite3_deserialize(
10468
10602
  # undef double
10469
10603
  #endif
10470
10604
 
10605
+ #if defined(__wasi__)
10606
+ # undef SQLITE_WASI
10607
+ # define SQLITE_WASI 1
10608
+ # undef SQLITE_OMIT_WAL
10609
+ # define SQLITE_OMIT_WAL 1/* because it requires shared memory APIs */
10610
+ # ifndef SQLITE_OMIT_LOAD_EXTENSION
10611
+ # define SQLITE_OMIT_LOAD_EXTENSION
10612
+ # endif
10613
+ # ifndef SQLITE_THREADSAFE
10614
+ # define SQLITE_THREADSAFE 0
10615
+ # endif
10616
+ #endif
10617
+
10471
10618
  #ifdef __cplusplus
10472
10619
  } /* End of the 'extern "C"' block */
10473
10620
  #endif
@@ -10674,16 +10821,20 @@ SQLITE_API int sqlite3session_create(
10674
10821
  SQLITE_API void sqlite3session_delete(sqlite3_session *pSession);
10675
10822
 
10676
10823
  /*
10677
- ** CAPIREF: Conigure a Session Object
10824
+ ** CAPI3REF: Configure a Session Object
10678
10825
  ** METHOD: sqlite3_session
10679
10826
  **
10680
10827
  ** This method is used to configure a session object after it has been
10681
- ** created. At present the only valid value for the second parameter is
10682
- ** [SQLITE_SESSION_OBJCONFIG_SIZE].
10828
+ ** created. At present the only valid values for the second parameter are
10829
+ ** [SQLITE_SESSION_OBJCONFIG_SIZE] and [SQLITE_SESSION_OBJCONFIG_ROWID].
10683
10830
  **
10684
- ** Arguments for sqlite3session_object_config()
10831
+ */
10832
+ SQLITE_API int sqlite3session_object_config(sqlite3_session*, int op, void *pArg);
10833
+
10834
+ /*
10835
+ ** CAPI3REF: Options for sqlite3session_object_config
10685
10836
  **
10686
- ** The following values may passed as the the 4th parameter to
10837
+ ** The following values may passed as the the 2nd parameter to
10687
10838
  ** sqlite3session_object_config().
10688
10839
  **
10689
10840
  ** <dt>SQLITE_SESSION_OBJCONFIG_SIZE <dd>
@@ -10699,12 +10850,21 @@ SQLITE_API void sqlite3session_delete(sqlite3_session *pSession);
10699
10850
  **
10700
10851
  ** It is an error (SQLITE_MISUSE) to attempt to modify this setting after
10701
10852
  ** the first table has been attached to the session object.
10853
+ **
10854
+ ** <dt>SQLITE_SESSION_OBJCONFIG_ROWID <dd>
10855
+ ** This option is used to set, clear or query the flag that enables
10856
+ ** collection of data for tables with no explicit PRIMARY KEY.
10857
+ **
10858
+ ** Normally, tables with no explicit PRIMARY KEY are simply ignored
10859
+ ** by the sessions module. However, if this flag is set, it behaves
10860
+ ** as if such tables have a column "_rowid_ INTEGER PRIMARY KEY" inserted
10861
+ ** as their leftmost columns.
10862
+ **
10863
+ ** It is an error (SQLITE_MISUSE) to attempt to modify this setting after
10864
+ ** the first table has been attached to the session object.
10702
10865
  */
10703
- SQLITE_API int sqlite3session_object_config(sqlite3_session*, int op, void *pArg);
10704
-
10705
- /*
10706
- */
10707
- #define SQLITE_SESSION_OBJCONFIG_SIZE 1
10866
+ #define SQLITE_SESSION_OBJCONFIG_SIZE 1
10867
+ #define SQLITE_SESSION_OBJCONFIG_ROWID 2
10708
10868
 
10709
10869
  /*
10710
10870
  ** CAPI3REF: Enable Or Disable A Session Object
@@ -11837,9 +11997,23 @@ SQLITE_API int sqlite3changeset_apply_v2(
11837
11997
  ** Invert the changeset before applying it. This is equivalent to inverting
11838
11998
  ** a changeset using sqlite3changeset_invert() before applying it. It is
11839
11999
  ** an error to specify this flag with a patchset.
12000
+ **
12001
+ ** <dt>SQLITE_CHANGESETAPPLY_IGNORENOOP <dd>
12002
+ ** Do not invoke the conflict handler callback for any changes that
12003
+ ** would not actually modify the database even if they were applied.
12004
+ ** Specifically, this means that the conflict handler is not invoked
12005
+ ** for:
12006
+ ** <ul>
12007
+ ** <li>a delete change if the row being deleted cannot be found,
12008
+ ** <li>an update change if the modified fields are already set to
12009
+ ** their new values in the conflicting row, or
12010
+ ** <li>an insert change if all fields of the conflicting row match
12011
+ ** the row being inserted.
12012
+ ** </ul>
11840
12013
  */
11841
12014
  #define SQLITE_CHANGESETAPPLY_NOSAVEPOINT 0x0001
11842
12015
  #define SQLITE_CHANGESETAPPLY_INVERT 0x0002
12016
+ #define SQLITE_CHANGESETAPPLY_IGNORENOOP 0x0004
11843
12017
 
11844
12018
  /*
11845
12019
  ** CAPI3REF: Constants Passed To The Conflict Handler