better-sqlite3-multiple-ciphers 12.2.0 → 12.4.6
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.
- package/README.md +4 -4
- package/deps/sqlite3/sqlite3.c +12079 -9160
- package/deps/sqlite3/sqlite3.h +347 -154
- package/deps/sqlite3/sqlite3ext.h +7 -0
- package/deps/update-sqlite3mc.sh +2 -2
- package/lib/database.js +1 -1
- package/package.json +3 -6
- package/src/addon.cpp +47 -0
- package/src/better_sqlite3.cpp +74 -2233
- package/src/objects/backup.cpp +120 -0
- package/src/objects/backup.hpp +36 -0
- package/src/objects/database.cpp +457 -0
- package/src/objects/database.hpp +105 -0
- package/src/objects/statement-iterator.cpp +113 -0
- package/src/objects/statement-iterator.hpp +50 -0
- package/src/objects/statement.cpp +383 -0
- package/src/objects/statement.hpp +58 -0
- package/src/util/bind-map.cpp +73 -0
- package/src/util/binder.cpp +193 -0
- package/src/util/constants.cpp +172 -0
- package/src/util/custom-aggregate.cpp +121 -0
- package/src/util/custom-function.cpp +59 -0
- package/src/util/custom-table.cpp +409 -0
- package/src/util/data-converter.cpp +17 -0
- package/src/util/data.cpp +194 -0
- package/src/util/helpers.cpp +109 -0
- package/src/util/macros.cpp +70 -0
- package/src/util/query-macros.cpp +71 -0
- package/src/util/row-builder.cpp +49 -0
- package/src/better_sqlite3.hpp +0 -1040
package/deps/sqlite3/sqlite3.h
CHANGED
|
@@ -31,9 +31,9 @@
|
|
|
31
31
|
|
|
32
32
|
#define SQLITE3MC_VERSION_MAJOR 2
|
|
33
33
|
#define SQLITE3MC_VERSION_MINOR 2
|
|
34
|
-
#define SQLITE3MC_VERSION_RELEASE
|
|
34
|
+
#define SQLITE3MC_VERSION_RELEASE 5
|
|
35
35
|
#define SQLITE3MC_VERSION_SUBRELEASE 0
|
|
36
|
-
#define SQLITE3MC_VERSION_STRING "SQLite3 Multiple Ciphers 2.2.
|
|
36
|
+
#define SQLITE3MC_VERSION_STRING "SQLite3 Multiple Ciphers 2.2.5"
|
|
37
37
|
|
|
38
38
|
#endif /* SQLITE3MC_VERSION_H_ */
|
|
39
39
|
/*** End of #include "sqlite3mc_version.h" ***/
|
|
@@ -192,9 +192,12 @@ extern "C" {
|
|
|
192
192
|
** [sqlite3_libversion_number()], [sqlite3_sourceid()],
|
|
193
193
|
** [sqlite_version()] and [sqlite_source_id()].
|
|
194
194
|
*/
|
|
195
|
-
#define SQLITE_VERSION "3.
|
|
196
|
-
#define SQLITE_VERSION_NUMBER
|
|
197
|
-
#define SQLITE_SOURCE_ID "2025-
|
|
195
|
+
#define SQLITE_VERSION "3.51.0"
|
|
196
|
+
#define SQLITE_VERSION_NUMBER 3051000
|
|
197
|
+
#define SQLITE_SOURCE_ID "2025-11-04 19:38:17 fb2c931ae597f8d00a37574ff67aeed3eced4e5547f9120744a-experimental"
|
|
198
|
+
#define SQLITE_SCM_BRANCH "unknown"
|
|
199
|
+
#define SQLITE_SCM_TAGS "unknown"
|
|
200
|
+
#define SQLITE_SCM_DATETIME "2025-11-04T19:38:17.314Z"
|
|
198
201
|
|
|
199
202
|
/*
|
|
200
203
|
** CAPI3REF: Run-Time Library Version Numbers
|
|
@@ -214,9 +217,9 @@ extern "C" {
|
|
|
214
217
|
** assert( strcmp(sqlite3_libversion(),SQLITE_VERSION)==0 );
|
|
215
218
|
** </pre></blockquote>)^
|
|
216
219
|
**
|
|
217
|
-
** ^The sqlite3_version[] string constant contains the text of
|
|
218
|
-
** macro. ^The sqlite3_libversion() function returns a
|
|
219
|
-
** to the sqlite3_version[] string constant. The sqlite3_libversion()
|
|
220
|
+
** ^The sqlite3_version[] string constant contains the text of the
|
|
221
|
+
** [SQLITE_VERSION] macro. ^The sqlite3_libversion() function returns a
|
|
222
|
+
** pointer to the sqlite3_version[] string constant. The sqlite3_libversion()
|
|
220
223
|
** function is provided for use in DLLs since DLL users usually do not have
|
|
221
224
|
** direct access to string constants within the DLL. ^The
|
|
222
225
|
** sqlite3_libversion_number() function returns an integer equal to
|
|
@@ -416,7 +419,7 @@ typedef int (*sqlite3_callback)(void*,int,char**, char**);
|
|
|
416
419
|
** without having to use a lot of C code.
|
|
417
420
|
**
|
|
418
421
|
** ^The sqlite3_exec() interface runs zero or more UTF-8 encoded,
|
|
419
|
-
** semicolon-
|
|
422
|
+
** semicolon-separated SQL statements passed into its 2nd argument,
|
|
420
423
|
** in the context of the [database connection] passed in as its 1st
|
|
421
424
|
** argument. ^If the callback function of the 3rd argument to
|
|
422
425
|
** sqlite3_exec() is not NULL, then it is invoked for each result row
|
|
@@ -449,7 +452,7 @@ typedef int (*sqlite3_callback)(void*,int,char**, char**);
|
|
|
449
452
|
** result row is NULL then the corresponding string pointer for the
|
|
450
453
|
** sqlite3_exec() callback is a NULL pointer. ^The 4th argument to the
|
|
451
454
|
** sqlite3_exec() callback is an array of pointers to strings where each
|
|
452
|
-
** entry represents the name of corresponding result column as obtained
|
|
455
|
+
** entry represents the name of a corresponding result column as obtained
|
|
453
456
|
** from [sqlite3_column_name()].
|
|
454
457
|
**
|
|
455
458
|
** ^If the 2nd parameter to sqlite3_exec() is a NULL pointer, a pointer
|
|
@@ -543,6 +546,9 @@ SQLITE_API int sqlite3_exec(
|
|
|
543
546
|
#define SQLITE_ERROR_MISSING_COLLSEQ (SQLITE_ERROR | (1<<8))
|
|
544
547
|
#define SQLITE_ERROR_RETRY (SQLITE_ERROR | (2<<8))
|
|
545
548
|
#define SQLITE_ERROR_SNAPSHOT (SQLITE_ERROR | (3<<8))
|
|
549
|
+
#define SQLITE_ERROR_RESERVESIZE (SQLITE_ERROR | (4<<8))
|
|
550
|
+
#define SQLITE_ERROR_KEY (SQLITE_ERROR | (5<<8))
|
|
551
|
+
#define SQLITE_ERROR_UNABLE (SQLITE_ERROR | (6<<8))
|
|
546
552
|
#define SQLITE_IOERR_READ (SQLITE_IOERR | (1<<8))
|
|
547
553
|
#define SQLITE_IOERR_SHORT_READ (SQLITE_IOERR | (2<<8))
|
|
548
554
|
#define SQLITE_IOERR_WRITE (SQLITE_IOERR | (3<<8))
|
|
@@ -577,6 +583,8 @@ SQLITE_API int sqlite3_exec(
|
|
|
577
583
|
#define SQLITE_IOERR_DATA (SQLITE_IOERR | (32<<8))
|
|
578
584
|
#define SQLITE_IOERR_CORRUPTFS (SQLITE_IOERR | (33<<8))
|
|
579
585
|
#define SQLITE_IOERR_IN_PAGE (SQLITE_IOERR | (34<<8))
|
|
586
|
+
#define SQLITE_IOERR_BADKEY (SQLITE_IOERR | (35<<8))
|
|
587
|
+
#define SQLITE_IOERR_CODEC (SQLITE_IOERR | (36<<8))
|
|
580
588
|
#define SQLITE_LOCKED_SHAREDCACHE (SQLITE_LOCKED | (1<<8))
|
|
581
589
|
#define SQLITE_LOCKED_VTAB (SQLITE_LOCKED | (2<<8))
|
|
582
590
|
#define SQLITE_BUSY_RECOVERY (SQLITE_BUSY | (1<<8))
|
|
@@ -635,7 +643,7 @@ SQLITE_API int sqlite3_exec(
|
|
|
635
643
|
** Note in particular that passing the SQLITE_OPEN_EXCLUSIVE flag into
|
|
636
644
|
** [sqlite3_open_v2()] does *not* cause the underlying database file
|
|
637
645
|
** to be opened using O_EXCL. Passing SQLITE_OPEN_EXCLUSIVE into
|
|
638
|
-
** [sqlite3_open_v2()] has historically
|
|
646
|
+
** [sqlite3_open_v2()] has historically been a no-op and might become an
|
|
639
647
|
** error in future versions of SQLite.
|
|
640
648
|
*/
|
|
641
649
|
#define SQLITE_OPEN_READONLY 0x00000001 /* Ok for sqlite3_open_v2() */
|
|
@@ -729,7 +737,7 @@ SQLITE_API int sqlite3_exec(
|
|
|
729
737
|
** SQLite uses one of these integer values as the second
|
|
730
738
|
** argument to calls it makes to the xLock() and xUnlock() methods
|
|
731
739
|
** of an [sqlite3_io_methods] object. These values are ordered from
|
|
732
|
-
**
|
|
740
|
+
** least restrictive to most restrictive.
|
|
733
741
|
**
|
|
734
742
|
** The argument to xLock() is always SHARED or higher. The argument to
|
|
735
743
|
** xUnlock is either SHARED or NONE.
|
|
@@ -970,7 +978,7 @@ struct sqlite3_io_methods {
|
|
|
970
978
|
** connection. See also [SQLITE_FCNTL_FILE_POINTER].
|
|
971
979
|
**
|
|
972
980
|
** <li>[[SQLITE_FCNTL_SYNC_OMITTED]]
|
|
973
|
-
**
|
|
981
|
+
** The SQLITE_FCNTL_SYNC_OMITTED file-control is no longer used.
|
|
974
982
|
**
|
|
975
983
|
** <li>[[SQLITE_FCNTL_SYNC]]
|
|
976
984
|
** The [SQLITE_FCNTL_SYNC] opcode is generated internally by SQLite and
|
|
@@ -1045,7 +1053,7 @@ struct sqlite3_io_methods {
|
|
|
1045
1053
|
**
|
|
1046
1054
|
** <li>[[SQLITE_FCNTL_VFSNAME]]
|
|
1047
1055
|
** ^The [SQLITE_FCNTL_VFSNAME] opcode can be used to obtain the names of
|
|
1048
|
-
** all [VFSes] in the VFS stack. The names
|
|
1056
|
+
** all [VFSes] in the VFS stack. The names of all VFS shims and the
|
|
1049
1057
|
** final bottom-level VFS are written into memory obtained from
|
|
1050
1058
|
** [sqlite3_malloc()] and the result is stored in the char* variable
|
|
1051
1059
|
** that the fourth parameter of [sqlite3_file_control()] points to.
|
|
@@ -1059,7 +1067,7 @@ struct sqlite3_io_methods {
|
|
|
1059
1067
|
** ^The [SQLITE_FCNTL_VFS_POINTER] opcode finds a pointer to the top-level
|
|
1060
1068
|
** [VFSes] currently in use. ^(The argument X in
|
|
1061
1069
|
** sqlite3_file_control(db,SQLITE_FCNTL_VFS_POINTER,X) must be
|
|
1062
|
-
** of type "[sqlite3_vfs] **". This
|
|
1070
|
+
** of type "[sqlite3_vfs] **". This opcode will set *X
|
|
1063
1071
|
** to a pointer to the top-level VFS.)^
|
|
1064
1072
|
** ^When there are multiple VFS shims in the stack, this opcode finds the
|
|
1065
1073
|
** upper-most shim only.
|
|
@@ -1249,7 +1257,7 @@ struct sqlite3_io_methods {
|
|
|
1249
1257
|
** <li>[[SQLITE_FCNTL_EXTERNAL_READER]]
|
|
1250
1258
|
** The EXPERIMENTAL [SQLITE_FCNTL_EXTERNAL_READER] opcode is used to detect
|
|
1251
1259
|
** whether or not there is a database client in another process with a wal-mode
|
|
1252
|
-
** transaction open on the database or not. It is only available on unix.The
|
|
1260
|
+
** transaction open on the database or not. It is only available on unix. The
|
|
1253
1261
|
** (void*) argument passed with this file-control should be a pointer to a
|
|
1254
1262
|
** value of type (int). The integer value is set to 1 if the database is a wal
|
|
1255
1263
|
** mode database and there exists at least one client in another process that
|
|
@@ -1267,6 +1275,15 @@ struct sqlite3_io_methods {
|
|
|
1267
1275
|
** database is not a temp db, then the [SQLITE_FCNTL_RESET_CACHE] file-control
|
|
1268
1276
|
** purges the contents of the in-memory page cache. If there is an open
|
|
1269
1277
|
** transaction, or if the db is a temp-db, this opcode is a no-op, not an error.
|
|
1278
|
+
**
|
|
1279
|
+
** <li>[[SQLITE_FCNTL_FILESTAT]]
|
|
1280
|
+
** The [SQLITE_FCNTL_FILESTAT] opcode returns low-level diagnostic information
|
|
1281
|
+
** about the [sqlite3_file] objects used access the database and journal files
|
|
1282
|
+
** for the given schema. The fourth parameter to [sqlite3_file_control()]
|
|
1283
|
+
** should be an initialized [sqlite3_str] pointer. JSON text describing
|
|
1284
|
+
** various aspects of the sqlite3_file object is appended to the sqlite3_str.
|
|
1285
|
+
** The SQLITE_FCNTL_FILESTAT opcode is usually a no-op, unless compile-time
|
|
1286
|
+
** options are used to enable it.
|
|
1270
1287
|
** </ul>
|
|
1271
1288
|
*/
|
|
1272
1289
|
#define SQLITE_FCNTL_LOCKSTATE 1
|
|
@@ -1312,6 +1329,7 @@ struct sqlite3_io_methods {
|
|
|
1312
1329
|
#define SQLITE_FCNTL_RESET_CACHE 42
|
|
1313
1330
|
#define SQLITE_FCNTL_NULL_IO 43
|
|
1314
1331
|
#define SQLITE_FCNTL_BLOCK_ON_CONNECT 44
|
|
1332
|
+
#define SQLITE_FCNTL_FILESTAT 45
|
|
1315
1333
|
|
|
1316
1334
|
/* deprecated names */
|
|
1317
1335
|
#define SQLITE_GET_LOCKPROXYFILE SQLITE_FCNTL_GET_LOCKPROXYFILE
|
|
@@ -1674,7 +1692,7 @@ struct sqlite3_vfs {
|
|
|
1674
1692
|
** SQLite interfaces so that an application usually does not need to
|
|
1675
1693
|
** invoke sqlite3_initialize() directly. For example, [sqlite3_open()]
|
|
1676
1694
|
** calls sqlite3_initialize() so the SQLite library will be automatically
|
|
1677
|
-
** initialized when [sqlite3_open()] is called if it has not
|
|
1695
|
+
** initialized when [sqlite3_open()] is called if it has not been initialized
|
|
1678
1696
|
** already. ^However, if SQLite is compiled with the [SQLITE_OMIT_AUTOINIT]
|
|
1679
1697
|
** compile-time option, then the automatic calls to sqlite3_initialize()
|
|
1680
1698
|
** are omitted and the application must call sqlite3_initialize() directly
|
|
@@ -1931,21 +1949,21 @@ struct sqlite3_mem_methods {
|
|
|
1931
1949
|
** The [sqlite3_mem_methods]
|
|
1932
1950
|
** structure is filled with the currently defined memory allocation routines.)^
|
|
1933
1951
|
** This option can be used to overload the default memory allocation
|
|
1934
|
-
** routines with a wrapper that
|
|
1952
|
+
** routines with a wrapper that simulates memory allocation failure or
|
|
1935
1953
|
** tracks memory usage, for example. </dd>
|
|
1936
1954
|
**
|
|
1937
1955
|
** [[SQLITE_CONFIG_SMALL_MALLOC]] <dt>SQLITE_CONFIG_SMALL_MALLOC</dt>
|
|
1938
|
-
** <dd> ^The SQLITE_CONFIG_SMALL_MALLOC option takes single argument of
|
|
1956
|
+
** <dd> ^The SQLITE_CONFIG_SMALL_MALLOC option takes a single argument of
|
|
1939
1957
|
** type int, interpreted as a boolean, which if true provides a hint to
|
|
1940
1958
|
** SQLite that it should avoid large memory allocations if possible.
|
|
1941
1959
|
** SQLite will run faster if it is free to make large memory allocations,
|
|
1942
|
-
** but some
|
|
1960
|
+
** but some applications might prefer to run slower in exchange for
|
|
1943
1961
|
** guarantees about memory fragmentation that are possible if large
|
|
1944
1962
|
** allocations are avoided. This hint is normally off.
|
|
1945
1963
|
** </dd>
|
|
1946
1964
|
**
|
|
1947
1965
|
** [[SQLITE_CONFIG_MEMSTATUS]] <dt>SQLITE_CONFIG_MEMSTATUS</dt>
|
|
1948
|
-
** <dd> ^The SQLITE_CONFIG_MEMSTATUS option takes single argument of type int,
|
|
1966
|
+
** <dd> ^The SQLITE_CONFIG_MEMSTATUS option takes a single argument of type int,
|
|
1949
1967
|
** interpreted as a boolean, which enables or disables the collection of
|
|
1950
1968
|
** memory allocation statistics. ^(When memory allocation statistics are
|
|
1951
1969
|
** disabled, the following SQLite interfaces become non-operational:
|
|
@@ -1990,7 +2008,7 @@ struct sqlite3_mem_methods {
|
|
|
1990
2008
|
** ^If pMem is NULL and N is non-zero, then each database connection
|
|
1991
2009
|
** does an initial bulk allocation for page cache memory
|
|
1992
2010
|
** from [sqlite3_malloc()] sufficient for N cache lines if N is positive or
|
|
1993
|
-
** of -1024*N bytes if N is negative
|
|
2011
|
+
** of -1024*N bytes if N is negative. ^If additional
|
|
1994
2012
|
** page cache memory is needed beyond what is provided by the initial
|
|
1995
2013
|
** allocation, then SQLite goes to [sqlite3_malloc()] separately for each
|
|
1996
2014
|
** additional cache line. </dd>
|
|
@@ -2019,7 +2037,7 @@ struct sqlite3_mem_methods {
|
|
|
2019
2037
|
** <dd> ^(The SQLITE_CONFIG_MUTEX option takes a single argument which is a
|
|
2020
2038
|
** pointer to an instance of the [sqlite3_mutex_methods] structure.
|
|
2021
2039
|
** The argument specifies alternative low-level mutex routines to be used
|
|
2022
|
-
** in place the mutex routines built into SQLite.)^ ^SQLite makes a copy of
|
|
2040
|
+
** in place of the mutex routines built into SQLite.)^ ^SQLite makes a copy of
|
|
2023
2041
|
** the content of the [sqlite3_mutex_methods] structure before the call to
|
|
2024
2042
|
** [sqlite3_config()] returns. ^If SQLite is compiled with
|
|
2025
2043
|
** the [SQLITE_THREADSAFE | SQLITE_THREADSAFE=0] compile-time option then
|
|
@@ -2061,7 +2079,7 @@ struct sqlite3_mem_methods {
|
|
|
2061
2079
|
**
|
|
2062
2080
|
** [[SQLITE_CONFIG_GETPCACHE2]] <dt>SQLITE_CONFIG_GETPCACHE2</dt>
|
|
2063
2081
|
** <dd> ^(The SQLITE_CONFIG_GETPCACHE2 option takes a single argument which
|
|
2064
|
-
** is a pointer to an [sqlite3_pcache_methods2] object. SQLite copies
|
|
2082
|
+
** is a pointer to an [sqlite3_pcache_methods2] object. SQLite copies off
|
|
2065
2083
|
** the current page cache implementation into that object.)^ </dd>
|
|
2066
2084
|
**
|
|
2067
2085
|
** [[SQLITE_CONFIG_LOG]] <dt>SQLITE_CONFIG_LOG</dt>
|
|
@@ -2078,7 +2096,7 @@ struct sqlite3_mem_methods {
|
|
|
2078
2096
|
** the logger function is a copy of the first parameter to the corresponding
|
|
2079
2097
|
** [sqlite3_log()] call and is intended to be a [result code] or an
|
|
2080
2098
|
** [extended result code]. ^The third parameter passed to the logger is
|
|
2081
|
-
** log message after formatting via [sqlite3_snprintf()].
|
|
2099
|
+
** a log message after formatting via [sqlite3_snprintf()].
|
|
2082
2100
|
** The SQLite logging interface is not reentrant; the logger function
|
|
2083
2101
|
** supplied by the application must not invoke any SQLite interface.
|
|
2084
2102
|
** In a multi-threaded application, the application-defined logger
|
|
@@ -2269,7 +2287,7 @@ struct sqlite3_mem_methods {
|
|
|
2269
2287
|
** These constants are the available integer configuration options that
|
|
2270
2288
|
** can be passed as the second parameter to the [sqlite3_db_config()] interface.
|
|
2271
2289
|
**
|
|
2272
|
-
** The [sqlite3_db_config()] interface is a var-args
|
|
2290
|
+
** The [sqlite3_db_config()] interface is a var-args function. It takes a
|
|
2273
2291
|
** variable number of parameters, though always at least two. The number of
|
|
2274
2292
|
** parameters passed into sqlite3_db_config() depends on which of these
|
|
2275
2293
|
** constants is given as the second parameter. This documentation page
|
|
@@ -2381,17 +2399,20 @@ struct sqlite3_mem_methods {
|
|
|
2381
2399
|
**
|
|
2382
2400
|
** [[SQLITE_DBCONFIG_ENABLE_FTS3_TOKENIZER]]
|
|
2383
2401
|
** <dt>SQLITE_DBCONFIG_ENABLE_FTS3_TOKENIZER</dt>
|
|
2384
|
-
** <dd> ^This option is used to enable or disable the
|
|
2385
|
-
** [fts3_tokenizer()] function
|
|
2386
|
-
**
|
|
2387
|
-
** There must be two additional arguments.
|
|
2388
|
-
**
|
|
2389
|
-
**
|
|
2390
|
-
**
|
|
2391
|
-
**
|
|
2392
|
-
**
|
|
2393
|
-
**
|
|
2394
|
-
**
|
|
2402
|
+
** <dd> ^This option is used to enable or disable using the
|
|
2403
|
+
** [fts3_tokenizer()] function - part of the [FTS3] full-text search engine
|
|
2404
|
+
** extension - without using bound parameters as the parameters. Doing so
|
|
2405
|
+
** is disabled by default. There must be two additional arguments. The first
|
|
2406
|
+
** argument is an integer. If it is passed 0, then using fts3_tokenizer()
|
|
2407
|
+
** without bound parameters is disabled. If it is passed a positive value,
|
|
2408
|
+
** then calling fts3_tokenizer without bound parameters is enabled. If it
|
|
2409
|
+
** is passed a negative value, this setting is not modified - this can be
|
|
2410
|
+
** used to query for the current setting. The second parameter is a pointer
|
|
2411
|
+
** to an integer into which is written 0 or 1 to indicate the current value
|
|
2412
|
+
** of this setting (after it is modified, if applicable). The second
|
|
2413
|
+
** parameter may be a NULL pointer, in which case the value of the setting
|
|
2414
|
+
** is not reported back. Refer to [FTS3] documentation for further details.
|
|
2415
|
+
** </dd>
|
|
2395
2416
|
**
|
|
2396
2417
|
** [[SQLITE_DBCONFIG_ENABLE_LOAD_EXTENSION]]
|
|
2397
2418
|
** <dt>SQLITE_DBCONFIG_ENABLE_LOAD_EXTENSION</dt>
|
|
@@ -2403,8 +2424,8 @@ struct sqlite3_mem_methods {
|
|
|
2403
2424
|
** When the first argument to this interface is 1, then only the C-API is
|
|
2404
2425
|
** enabled and the SQL function remains disabled. If the first argument to
|
|
2405
2426
|
** this interface is 0, then both the C-API and the SQL function are disabled.
|
|
2406
|
-
** If the first argument is -1, then no changes are made to state of either
|
|
2407
|
-
** C-API or the SQL function.
|
|
2427
|
+
** If the first argument is -1, then no changes are made to the state of either
|
|
2428
|
+
** the C-API or the SQL function.
|
|
2408
2429
|
** The second parameter is a pointer to an integer into which
|
|
2409
2430
|
** is written 0 or 1 to indicate whether [sqlite3_load_extension()] interface
|
|
2410
2431
|
** is disabled or enabled following this call. The second parameter may
|
|
@@ -2522,7 +2543,7 @@ struct sqlite3_mem_methods {
|
|
|
2522
2543
|
** [[SQLITE_DBCONFIG_LEGACY_ALTER_TABLE]]
|
|
2523
2544
|
** <dt>SQLITE_DBCONFIG_LEGACY_ALTER_TABLE</dt>
|
|
2524
2545
|
** <dd>The SQLITE_DBCONFIG_LEGACY_ALTER_TABLE option activates or deactivates
|
|
2525
|
-
** the legacy behavior of the [ALTER TABLE RENAME] command such it
|
|
2546
|
+
** the legacy behavior of the [ALTER TABLE RENAME] command such that it
|
|
2526
2547
|
** behaves as it did prior to [version 3.24.0] (2018-06-04). See the
|
|
2527
2548
|
** "Compatibility Notice" on the [ALTER TABLE RENAME documentation] for
|
|
2528
2549
|
** additional information. This feature can also be turned on and off
|
|
@@ -2571,7 +2592,7 @@ struct sqlite3_mem_methods {
|
|
|
2571
2592
|
** <dt>SQLITE_DBCONFIG_LEGACY_FILE_FORMAT</dt>
|
|
2572
2593
|
** <dd>The SQLITE_DBCONFIG_LEGACY_FILE_FORMAT option activates or deactivates
|
|
2573
2594
|
** the legacy file format flag. When activated, this flag causes all newly
|
|
2574
|
-
** created database
|
|
2595
|
+
** created database files to have a schema format version number (the 4-byte
|
|
2575
2596
|
** integer found at offset 44 into the database header) of 1. This in turn
|
|
2576
2597
|
** means that the resulting database file will be readable and writable by
|
|
2577
2598
|
** any SQLite version back to 3.0.0 ([dateof:3.0.0]). Without this setting,
|
|
@@ -2598,7 +2619,7 @@ struct sqlite3_mem_methods {
|
|
|
2598
2619
|
** the database handle both when the SQL statement is prepared and when it
|
|
2599
2620
|
** is stepped. The flag is set (collection of statistics is enabled)
|
|
2600
2621
|
** by default. <p>This option takes two arguments: an integer and a pointer to
|
|
2601
|
-
** an integer
|
|
2622
|
+
** an integer. The first argument is 1, 0, or -1 to enable, disable, or
|
|
2602
2623
|
** leave unchanged the statement scanstatus option. If the second argument
|
|
2603
2624
|
** is not NULL, then the value of the statement scanstatus setting after
|
|
2604
2625
|
** processing the first argument is written into the integer that the second
|
|
@@ -2641,8 +2662,8 @@ struct sqlite3_mem_methods {
|
|
|
2641
2662
|
** <dd>The SQLITE_DBCONFIG_ENABLE_ATTACH_WRITE option enables or disables the
|
|
2642
2663
|
** ability of the [ATTACH DATABASE] SQL command to open a database for writing.
|
|
2643
2664
|
** This capability is enabled by default. Applications can disable or
|
|
2644
|
-
** reenable this capability using the current DBCONFIG option. If
|
|
2645
|
-
**
|
|
2665
|
+
** reenable this capability using the current DBCONFIG option. If
|
|
2666
|
+
** this capability is disabled, the [ATTACH] command will still work,
|
|
2646
2667
|
** but the database will be opened read-only. If this option is disabled,
|
|
2647
2668
|
** then the ability to create a new database using [ATTACH] is also disabled,
|
|
2648
2669
|
** regardless of the value of the [SQLITE_DBCONFIG_ENABLE_ATTACH_CREATE]
|
|
@@ -2676,7 +2697,7 @@ struct sqlite3_mem_methods {
|
|
|
2676
2697
|
**
|
|
2677
2698
|
** <p>Most of the SQLITE_DBCONFIG options take two arguments, so that the
|
|
2678
2699
|
** overall call to [sqlite3_db_config()] has a total of four parameters.
|
|
2679
|
-
** The first argument (the third parameter to sqlite3_db_config()) is
|
|
2700
|
+
** The first argument (the third parameter to sqlite3_db_config()) is an integer.
|
|
2680
2701
|
** The second argument is a pointer to an integer. If the first argument is 1,
|
|
2681
2702
|
** then the option becomes enabled. If the first integer argument is 0, then the
|
|
2682
2703
|
** option is disabled. If the first argument is -1, then the option setting
|
|
@@ -2966,7 +2987,7 @@ SQLITE_API int sqlite3_is_interrupted(sqlite3*);
|
|
|
2966
2987
|
** ^These routines return 0 if the statement is incomplete. ^If a
|
|
2967
2988
|
** memory allocation fails, then SQLITE_NOMEM is returned.
|
|
2968
2989
|
**
|
|
2969
|
-
** ^These routines do not parse the SQL statements thus
|
|
2990
|
+
** ^These routines do not parse the SQL statements and thus
|
|
2970
2991
|
** will not detect syntactically incorrect SQL.
|
|
2971
2992
|
**
|
|
2972
2993
|
** ^(If SQLite has not been initialized using [sqlite3_initialize()] prior
|
|
@@ -3083,7 +3104,7 @@ SQLITE_API int sqlite3_busy_timeout(sqlite3*, int ms);
|
|
|
3083
3104
|
** indefinitely if possible. The results of passing any other negative value
|
|
3084
3105
|
** are undefined.
|
|
3085
3106
|
**
|
|
3086
|
-
** Internally, each SQLite database handle
|
|
3107
|
+
** Internally, each SQLite database handle stores two timeout values - the
|
|
3087
3108
|
** busy-timeout (used for rollback mode databases, or if the VFS does not
|
|
3088
3109
|
** support blocking locks) and the setlk-timeout (used for blocking locks
|
|
3089
3110
|
** on wal-mode databases). The sqlite3_busy_timeout() method sets both
|
|
@@ -3113,7 +3134,7 @@ SQLITE_API int sqlite3_setlk_timeout(sqlite3*, int ms, int flags);
|
|
|
3113
3134
|
** This is a legacy interface that is preserved for backwards compatibility.
|
|
3114
3135
|
** Use of this interface is not recommended.
|
|
3115
3136
|
**
|
|
3116
|
-
** Definition: A <b>result table</b> is memory data structure created by the
|
|
3137
|
+
** Definition: A <b>result table</b> is a memory data structure created by the
|
|
3117
3138
|
** [sqlite3_get_table()] interface. A result table records the
|
|
3118
3139
|
** complete query results from one or more queries.
|
|
3119
3140
|
**
|
|
@@ -3256,7 +3277,7 @@ SQLITE_API char *sqlite3_vsnprintf(int,char*,const char*, va_list);
|
|
|
3256
3277
|
** ^Calling sqlite3_free() with a pointer previously returned
|
|
3257
3278
|
** by sqlite3_malloc() or sqlite3_realloc() releases that memory so
|
|
3258
3279
|
** that it might be reused. ^The sqlite3_free() routine is
|
|
3259
|
-
** a no-op if is called with a NULL pointer. Passing a NULL pointer
|
|
3280
|
+
** a no-op if it is called with a NULL pointer. Passing a NULL pointer
|
|
3260
3281
|
** to sqlite3_free() is harmless. After being freed, memory
|
|
3261
3282
|
** should neither be read nor written. Even reading previously freed
|
|
3262
3283
|
** memory might result in a segmentation fault or other severe error.
|
|
@@ -3274,13 +3295,13 @@ SQLITE_API char *sqlite3_vsnprintf(int,char*,const char*, va_list);
|
|
|
3274
3295
|
** sqlite3_free(X).
|
|
3275
3296
|
** ^sqlite3_realloc(X,N) returns a pointer to a memory allocation
|
|
3276
3297
|
** of at least N bytes in size or NULL if insufficient memory is available.
|
|
3277
|
-
** ^If M is the size of the prior allocation, then min(N,M) bytes
|
|
3278
|
-
**
|
|
3298
|
+
** ^If M is the size of the prior allocation, then min(N,M) bytes of the
|
|
3299
|
+
** prior allocation are copied into the beginning of the buffer returned
|
|
3279
3300
|
** by sqlite3_realloc(X,N) and the prior allocation is freed.
|
|
3280
3301
|
** ^If sqlite3_realloc(X,N) returns NULL and N is positive, then the
|
|
3281
3302
|
** prior allocation is not freed.
|
|
3282
3303
|
**
|
|
3283
|
-
** ^The sqlite3_realloc64(X,N)
|
|
3304
|
+
** ^The sqlite3_realloc64(X,N) interface works the same as
|
|
3284
3305
|
** sqlite3_realloc(X,N) except that N is a 64-bit unsigned integer instead
|
|
3285
3306
|
** of a 32-bit signed integer.
|
|
3286
3307
|
**
|
|
@@ -3330,7 +3351,7 @@ SQLITE_API sqlite3_uint64 sqlite3_msize(void*);
|
|
|
3330
3351
|
** was last reset. ^The values returned by [sqlite3_memory_used()] and
|
|
3331
3352
|
** [sqlite3_memory_highwater()] include any overhead
|
|
3332
3353
|
** added by SQLite in its implementation of [sqlite3_malloc()],
|
|
3333
|
-
** but not overhead added by
|
|
3354
|
+
** but not overhead added by any underlying system library
|
|
3334
3355
|
** routines that [sqlite3_malloc()] may call.
|
|
3335
3356
|
**
|
|
3336
3357
|
** ^The memory high-water mark is reset to the current value of
|
|
@@ -3782,7 +3803,7 @@ SQLITE_API void sqlite3_progress_handler(sqlite3*, int, int(*)(void*), void*);
|
|
|
3782
3803
|
** there is no harm in trying.)
|
|
3783
3804
|
**
|
|
3784
3805
|
** ^(<dt>[SQLITE_OPEN_SHAREDCACHE]</dt>
|
|
3785
|
-
** <dd>The database is opened [shared cache] enabled, overriding
|
|
3806
|
+
** <dd>The database is opened with [shared cache] enabled, overriding
|
|
3786
3807
|
** the default shared cache setting provided by
|
|
3787
3808
|
** [sqlite3_enable_shared_cache()].)^
|
|
3788
3809
|
** The [use of shared cache mode is discouraged] and hence shared cache
|
|
@@ -3790,7 +3811,7 @@ SQLITE_API void sqlite3_progress_handler(sqlite3*, int, int(*)(void*), void*);
|
|
|
3790
3811
|
** this option is a no-op.
|
|
3791
3812
|
**
|
|
3792
3813
|
** ^(<dt>[SQLITE_OPEN_PRIVATECACHE]</dt>
|
|
3793
|
-
** <dd>The database is opened [shared cache] disabled, overriding
|
|
3814
|
+
** <dd>The database is opened with [shared cache] disabled, overriding
|
|
3794
3815
|
** the default shared cache setting provided by
|
|
3795
3816
|
** [sqlite3_enable_shared_cache()].)^
|
|
3796
3817
|
**
|
|
@@ -4208,7 +4229,7 @@ SQLITE_API void sqlite3_free_filename(sqlite3_filename);
|
|
|
4208
4229
|
** subsequent calls to other SQLite interface functions.)^
|
|
4209
4230
|
**
|
|
4210
4231
|
** ^The sqlite3_errstr(E) interface returns the English-language text
|
|
4211
|
-
** that describes the [result code] E, as UTF-8, or NULL if E is not
|
|
4232
|
+
** that describes the [result code] E, as UTF-8, or NULL if E is not a
|
|
4212
4233
|
** result code for which a text error message is available.
|
|
4213
4234
|
** ^(Memory to hold the error message string is managed internally
|
|
4214
4235
|
** and must not be freed by the application)^.
|
|
@@ -4216,7 +4237,7 @@ SQLITE_API void sqlite3_free_filename(sqlite3_filename);
|
|
|
4216
4237
|
** ^If the most recent error references a specific token in the input
|
|
4217
4238
|
** SQL, the sqlite3_error_offset() interface returns the byte offset
|
|
4218
4239
|
** of the start of that token. ^The byte offset returned by
|
|
4219
|
-
** sqlite3_error_offset() assumes that the input SQL is
|
|
4240
|
+
** sqlite3_error_offset() assumes that the input SQL is UTF-8.
|
|
4220
4241
|
** ^If the most recent error does not reference a specific token in the input
|
|
4221
4242
|
** SQL, then the sqlite3_error_offset() function returns -1.
|
|
4222
4243
|
**
|
|
@@ -4241,6 +4262,34 @@ SQLITE_API const void *sqlite3_errmsg16(sqlite3*);
|
|
|
4241
4262
|
SQLITE_API const char *sqlite3_errstr(int);
|
|
4242
4263
|
SQLITE_API int sqlite3_error_offset(sqlite3 *db);
|
|
4243
4264
|
|
|
4265
|
+
/*
|
|
4266
|
+
** CAPI3REF: Set Error Codes And Message
|
|
4267
|
+
** METHOD: sqlite3
|
|
4268
|
+
**
|
|
4269
|
+
** Set the error code of the database handle passed as the first argument
|
|
4270
|
+
** to errcode, and the error message to a copy of nul-terminated string
|
|
4271
|
+
** zErrMsg. If zErrMsg is passed NULL, then the error message is set to
|
|
4272
|
+
** the default message associated with the supplied error code. Subsequent
|
|
4273
|
+
** calls to [sqlite3_errcode()] and [sqlite3_errmsg()] and similar will
|
|
4274
|
+
** return the values set by this routine in place of what was previously
|
|
4275
|
+
** set by SQLite itself.
|
|
4276
|
+
**
|
|
4277
|
+
** This function returns SQLITE_OK if the error code and error message are
|
|
4278
|
+
** successfully set, SQLITE_NOMEM if an OOM occurs, and SQLITE_MISUSE if
|
|
4279
|
+
** the database handle is NULL or invalid.
|
|
4280
|
+
**
|
|
4281
|
+
** The error code and message set by this routine remains in effect until
|
|
4282
|
+
** they are changed, either by another call to this routine or until they are
|
|
4283
|
+
** changed to by SQLite itself to reflect the result of some subsquent
|
|
4284
|
+
** API call.
|
|
4285
|
+
**
|
|
4286
|
+
** This function is intended for use by SQLite extensions or wrappers. The
|
|
4287
|
+
** idea is that an extension or wrapper can use this routine to set error
|
|
4288
|
+
** messages and error codes and thus behave more like a core SQLite
|
|
4289
|
+
** feature from the point of view of an application.
|
|
4290
|
+
*/
|
|
4291
|
+
SQLITE_API int sqlite3_set_errmsg(sqlite3 *db, int errcode, const char *zErrMsg);
|
|
4292
|
+
|
|
4244
4293
|
/*
|
|
4245
4294
|
** CAPI3REF: Prepared Statement Object
|
|
4246
4295
|
** KEYWORDS: {prepared statement} {prepared statements}
|
|
@@ -4315,8 +4364,8 @@ SQLITE_API int sqlite3_limit(sqlite3*, int id, int newVal);
|
|
|
4315
4364
|
**
|
|
4316
4365
|
** These constants define various performance limits
|
|
4317
4366
|
** that can be lowered at run-time using [sqlite3_limit()].
|
|
4318
|
-
**
|
|
4319
|
-
**
|
|
4367
|
+
** A concise description of these limits follows, and additional information
|
|
4368
|
+
** is available at [limits | Limits in SQLite].
|
|
4320
4369
|
**
|
|
4321
4370
|
** <dl>
|
|
4322
4371
|
** [[SQLITE_LIMIT_LENGTH]] ^(<dt>SQLITE_LIMIT_LENGTH</dt>
|
|
@@ -4381,7 +4430,7 @@ SQLITE_API int sqlite3_limit(sqlite3*, int id, int newVal);
|
|
|
4381
4430
|
/*
|
|
4382
4431
|
** CAPI3REF: Prepare Flags
|
|
4383
4432
|
**
|
|
4384
|
-
** These constants define various flags that can be passed into
|
|
4433
|
+
** These constants define various flags that can be passed into the
|
|
4385
4434
|
** "prepFlags" parameter of the [sqlite3_prepare_v3()] and
|
|
4386
4435
|
** [sqlite3_prepare16_v3()] interfaces.
|
|
4387
4436
|
**
|
|
@@ -4468,7 +4517,7 @@ SQLITE_API int sqlite3_limit(sqlite3*, int id, int newVal);
|
|
|
4468
4517
|
** there is a small performance advantage to passing an nByte parameter that
|
|
4469
4518
|
** is the number of bytes in the input string <i>including</i>
|
|
4470
4519
|
** the nul-terminator.
|
|
4471
|
-
** Note that nByte
|
|
4520
|
+
** Note that nByte measures the length of the input in bytes, not
|
|
4472
4521
|
** characters, even for the UTF-16 interfaces.
|
|
4473
4522
|
**
|
|
4474
4523
|
** ^If pzTail is not NULL then *pzTail is made to point to the first byte
|
|
@@ -4602,7 +4651,7 @@ SQLITE_API int sqlite3_prepare16_v3(
|
|
|
4602
4651
|
**
|
|
4603
4652
|
** ^The sqlite3_expanded_sql() interface returns NULL if insufficient memory
|
|
4604
4653
|
** is available to hold the result, or if the result would exceed the
|
|
4605
|
-
**
|
|
4654
|
+
** maximum string length determined by the [SQLITE_LIMIT_LENGTH].
|
|
4606
4655
|
**
|
|
4607
4656
|
** ^The [SQLITE_TRACE_SIZE_LIMIT] compile-time option limits the size of
|
|
4608
4657
|
** bound parameter expansions. ^The [SQLITE_OMIT_TRACE] compile-time
|
|
@@ -4790,7 +4839,7 @@ typedef struct sqlite3_value sqlite3_value;
|
|
|
4790
4839
|
**
|
|
4791
4840
|
** The context in which an SQL function executes is stored in an
|
|
4792
4841
|
** sqlite3_context object. ^A pointer to an sqlite3_context object
|
|
4793
|
-
** is always first parameter to [application-defined SQL functions].
|
|
4842
|
+
** is always the first parameter to [application-defined SQL functions].
|
|
4794
4843
|
** The application-defined SQL function implementation will pass this
|
|
4795
4844
|
** pointer through into calls to [sqlite3_result_int | sqlite3_result()],
|
|
4796
4845
|
** [sqlite3_aggregate_context()], [sqlite3_user_data()],
|
|
@@ -4914,9 +4963,11 @@ typedef struct sqlite3_context sqlite3_context;
|
|
|
4914
4963
|
** associated with the pointer P of type T. ^D is either a NULL pointer or
|
|
4915
4964
|
** a pointer to a destructor function for P. ^SQLite will invoke the
|
|
4916
4965
|
** destructor D with a single argument of P when it is finished using
|
|
4917
|
-
** P
|
|
4918
|
-
**
|
|
4919
|
-
**
|
|
4966
|
+
** P, even if the call to sqlite3_bind_pointer() fails. Due to a
|
|
4967
|
+
** historical design quirk, results are undefined if D is
|
|
4968
|
+
** SQLITE_TRANSIENT. The T parameter should be a static string,
|
|
4969
|
+
** preferably a string literal. The sqlite3_bind_pointer() routine is
|
|
4970
|
+
** part of the [pointer passing interface] added for SQLite 3.20.0.
|
|
4920
4971
|
**
|
|
4921
4972
|
** ^If any of the sqlite3_bind_*() routines are called with a NULL pointer
|
|
4922
4973
|
** for the [prepared statement] or with a prepared statement for which
|
|
@@ -5527,7 +5578,7 @@ SQLITE_API int sqlite3_column_type(sqlite3_stmt*, int iCol);
|
|
|
5527
5578
|
**
|
|
5528
5579
|
** ^The sqlite3_finalize() function is called to delete a [prepared statement].
|
|
5529
5580
|
** ^If the most recent evaluation of the statement encountered no errors
|
|
5530
|
-
** or if the statement
|
|
5581
|
+
** or if the statement has never been evaluated, then sqlite3_finalize() returns
|
|
5531
5582
|
** SQLITE_OK. ^If the most recent evaluation of statement S failed, then
|
|
5532
5583
|
** sqlite3_finalize(S) returns the appropriate [error code] or
|
|
5533
5584
|
** [extended error code].
|
|
@@ -5759,7 +5810,7 @@ SQLITE_API int sqlite3_create_window_function(
|
|
|
5759
5810
|
/*
|
|
5760
5811
|
** CAPI3REF: Text Encodings
|
|
5761
5812
|
**
|
|
5762
|
-
** These
|
|
5813
|
+
** These constants define integer codes that represent the various
|
|
5763
5814
|
** text encodings supported by SQLite.
|
|
5764
5815
|
*/
|
|
5765
5816
|
#define SQLITE_UTF8 1 /* IMP: R-37514-35566 */
|
|
@@ -5851,7 +5902,7 @@ SQLITE_API int sqlite3_create_window_function(
|
|
|
5851
5902
|
** result.
|
|
5852
5903
|
** Every function that invokes [sqlite3_result_subtype()] should have this
|
|
5853
5904
|
** property. If it does not, then the call to [sqlite3_result_subtype()]
|
|
5854
|
-
** might become a no-op if the function is used as term in an
|
|
5905
|
+
** might become a no-op if the function is used as a term in an
|
|
5855
5906
|
** [expression index]. On the other hand, SQL functions that never invoke
|
|
5856
5907
|
** [sqlite3_result_subtype()] should avoid setting this property, as the
|
|
5857
5908
|
** purpose of this property is to disable certain optimizations that are
|
|
@@ -5978,7 +6029,7 @@ SQLITE_API SQLITE_DEPRECATED int sqlite3_memory_alarm(void(*)(void*,sqlite3_int6
|
|
|
5978
6029
|
** sqlite3_value_nochange(X) interface returns true if and only if
|
|
5979
6030
|
** the column corresponding to X is unchanged by the UPDATE operation
|
|
5980
6031
|
** that the xUpdate method call was invoked to implement and if
|
|
5981
|
-
**
|
|
6032
|
+
** the prior [xColumn] method call that was invoked to extract
|
|
5982
6033
|
** the value for that column returned without setting a result (probably
|
|
5983
6034
|
** because it queried [sqlite3_vtab_nochange()] and found that the column
|
|
5984
6035
|
** was unchanging). ^Within an [xUpdate] method, any value for which
|
|
@@ -6251,6 +6302,7 @@ SQLITE_API void sqlite3_set_auxdata(sqlite3_context*, int N, void*, void (*)(voi
|
|
|
6251
6302
|
** or a NULL pointer if there were no prior calls to
|
|
6252
6303
|
** sqlite3_set_clientdata() with the same values of D and N.
|
|
6253
6304
|
** Names are compared using strcmp() and are thus case sensitive.
|
|
6305
|
+
** It returns 0 on success and SQLITE_NOMEM on allocation failure.
|
|
6254
6306
|
**
|
|
6255
6307
|
** If P and X are both non-NULL, then the destructor X is invoked with
|
|
6256
6308
|
** argument P on the first of the following occurrences:
|
|
@@ -8927,9 +8979,18 @@ SQLITE_API int sqlite3_status64(
|
|
|
8927
8979
|
** ^The sqlite3_db_status() routine returns SQLITE_OK on success and a
|
|
8928
8980
|
** non-zero [error code] on failure.
|
|
8929
8981
|
**
|
|
8982
|
+
** ^The sqlite3_db_status64(D,O,C,H,R) routine works exactly the same
|
|
8983
|
+
** way as sqlite3_db_status(D,O,C,H,R) routine except that the C and H
|
|
8984
|
+
** parameters are pointer to 64-bit integers (type: sqlite3_int64) instead
|
|
8985
|
+
** of pointers to 32-bit integers, which allows larger status values
|
|
8986
|
+
** to be returned. If a status value exceeds 2,147,483,647 then
|
|
8987
|
+
** sqlite3_db_status() will truncate the value whereas sqlite3_db_status64()
|
|
8988
|
+
** will return the full value.
|
|
8989
|
+
**
|
|
8930
8990
|
** See also: [sqlite3_status()] and [sqlite3_stmt_status()].
|
|
8931
8991
|
*/
|
|
8932
8992
|
SQLITE_API int sqlite3_db_status(sqlite3*, int op, int *pCur, int *pHiwtr, int resetFlg);
|
|
8993
|
+
SQLITE_API int sqlite3_db_status64(sqlite3*,int,sqlite3_int64*,sqlite3_int64*,int);
|
|
8933
8994
|
|
|
8934
8995
|
/*
|
|
8935
8996
|
** CAPI3REF: Status Parameters for database connections
|
|
@@ -9026,6 +9087,10 @@ SQLITE_API int sqlite3_db_status(sqlite3*, int op, int *pCur, int *pHiwtr, int r
|
|
|
9026
9087
|
** If an IO or other error occurs while writing a page to disk, the effect
|
|
9027
9088
|
** on subsequent SQLITE_DBSTATUS_CACHE_WRITE requests is undefined.)^ ^The
|
|
9028
9089
|
** highwater mark associated with SQLITE_DBSTATUS_CACHE_WRITE is always 0.
|
|
9090
|
+
** <p>
|
|
9091
|
+
** ^(There is overlap between the quantities measured by this parameter
|
|
9092
|
+
** (SQLITE_DBSTATUS_CACHE_WRITE) and SQLITE_DBSTATUS_TEMPBUF_SPILL.
|
|
9093
|
+
** Resetting one will reduce the other.)^
|
|
9029
9094
|
** </dd>
|
|
9030
9095
|
**
|
|
9031
9096
|
** [[SQLITE_DBSTATUS_CACHE_SPILL]] ^(<dt>SQLITE_DBSTATUS_CACHE_SPILL</dt>
|
|
@@ -9041,6 +9106,18 @@ SQLITE_API int sqlite3_db_status(sqlite3*, int op, int *pCur, int *pHiwtr, int r
|
|
|
9041
9106
|
** <dd>This parameter returns zero for the current value if and only if
|
|
9042
9107
|
** all foreign key constraints (deferred or immediate) have been
|
|
9043
9108
|
** resolved.)^ ^The highwater mark is always 0.
|
|
9109
|
+
**
|
|
9110
|
+
** [[SQLITE_DBSTATUS_TEMPBUF_SPILL] ^(<dt>SQLITE_DBSTATUS_TEMPBUF_SPILL</dt>
|
|
9111
|
+
** <dd>^(This parameter returns the number of bytes written to temporary
|
|
9112
|
+
** files on disk that could have been kept in memory had sufficient memory
|
|
9113
|
+
** been available. This value includes writes to intermediate tables that
|
|
9114
|
+
** are part of complex queries, external sorts that spill to disk, and
|
|
9115
|
+
** writes to TEMP tables.)^
|
|
9116
|
+
** ^The highwater mark is always 0.
|
|
9117
|
+
** <p>
|
|
9118
|
+
** ^(There is overlap between the quantities measured by this parameter
|
|
9119
|
+
** (SQLITE_DBSTATUS_TEMPBUF_SPILL) and SQLITE_DBSTATUS_CACHE_WRITE.
|
|
9120
|
+
** Resetting one will reduce the other.)^
|
|
9044
9121
|
** </dd>
|
|
9045
9122
|
** </dl>
|
|
9046
9123
|
*/
|
|
@@ -9057,7 +9134,8 @@ SQLITE_API int sqlite3_db_status(sqlite3*, int op, int *pCur, int *pHiwtr, int r
|
|
|
9057
9134
|
#define SQLITE_DBSTATUS_DEFERRED_FKS 10
|
|
9058
9135
|
#define SQLITE_DBSTATUS_CACHE_USED_SHARED 11
|
|
9059
9136
|
#define SQLITE_DBSTATUS_CACHE_SPILL 12
|
|
9060
|
-
#define
|
|
9137
|
+
#define SQLITE_DBSTATUS_TEMPBUF_SPILL 13
|
|
9138
|
+
#define SQLITE_DBSTATUS_MAX 13 /* Largest defined DBSTATUS */
|
|
9061
9139
|
|
|
9062
9140
|
|
|
9063
9141
|
/*
|
|
@@ -9104,13 +9182,13 @@ SQLITE_API int sqlite3_stmt_status(sqlite3_stmt*, int op,int resetFlg);
|
|
|
9104
9182
|
** [[SQLITE_STMTSTATUS_SORT]] <dt>SQLITE_STMTSTATUS_SORT</dt>
|
|
9105
9183
|
** <dd>^This is the number of sort operations that have occurred.
|
|
9106
9184
|
** A non-zero value in this counter may indicate an opportunity to
|
|
9107
|
-
**
|
|
9185
|
+
** improve performance through careful use of indices.</dd>
|
|
9108
9186
|
**
|
|
9109
9187
|
** [[SQLITE_STMTSTATUS_AUTOINDEX]] <dt>SQLITE_STMTSTATUS_AUTOINDEX</dt>
|
|
9110
9188
|
** <dd>^This is the number of rows inserted into transient indices that
|
|
9111
9189
|
** were created automatically in order to help joins run faster.
|
|
9112
9190
|
** A non-zero value in this counter may indicate an opportunity to
|
|
9113
|
-
**
|
|
9191
|
+
** improve performance by adding permanent indices that do not
|
|
9114
9192
|
** need to be reinitialized each time the statement is run.</dd>
|
|
9115
9193
|
**
|
|
9116
9194
|
** [[SQLITE_STMTSTATUS_VM_STEP]] <dt>SQLITE_STMTSTATUS_VM_STEP</dt>
|
|
@@ -9119,19 +9197,19 @@ SQLITE_API int sqlite3_stmt_status(sqlite3_stmt*, int op,int resetFlg);
|
|
|
9119
9197
|
** to 2147483647. The number of virtual machine operations can be
|
|
9120
9198
|
** used as a proxy for the total work done by the prepared statement.
|
|
9121
9199
|
** If the number of virtual machine operations exceeds 2147483647
|
|
9122
|
-
** then the value returned by this statement status code is undefined
|
|
9200
|
+
** then the value returned by this statement status code is undefined.</dd>
|
|
9123
9201
|
**
|
|
9124
9202
|
** [[SQLITE_STMTSTATUS_REPREPARE]] <dt>SQLITE_STMTSTATUS_REPREPARE</dt>
|
|
9125
9203
|
** <dd>^This is the number of times that the prepare statement has been
|
|
9126
9204
|
** automatically regenerated due to schema changes or changes to
|
|
9127
|
-
** [bound parameters] that might affect the query plan
|
|
9205
|
+
** [bound parameters] that might affect the query plan.</dd>
|
|
9128
9206
|
**
|
|
9129
9207
|
** [[SQLITE_STMTSTATUS_RUN]] <dt>SQLITE_STMTSTATUS_RUN</dt>
|
|
9130
9208
|
** <dd>^This is the number of times that the prepared statement has
|
|
9131
9209
|
** been run. A single "run" for the purposes of this counter is one
|
|
9132
9210
|
** or more calls to [sqlite3_step()] followed by a call to [sqlite3_reset()].
|
|
9133
9211
|
** The counter is incremented on the first [sqlite3_step()] call of each
|
|
9134
|
-
** cycle
|
|
9212
|
+
** cycle.</dd>
|
|
9135
9213
|
**
|
|
9136
9214
|
** [[SQLITE_STMTSTATUS_FILTER_MISS]]
|
|
9137
9215
|
** [[SQLITE_STMTSTATUS_FILTER HIT]]
|
|
@@ -9141,7 +9219,7 @@ SQLITE_API int sqlite3_stmt_status(sqlite3_stmt*, int op,int resetFlg);
|
|
|
9141
9219
|
** step was bypassed because a Bloom filter returned not-found. The
|
|
9142
9220
|
** corresponding SQLITE_STMTSTATUS_FILTER_MISS value is the number of
|
|
9143
9221
|
** times that the Bloom filter returned a find, and thus the join step
|
|
9144
|
-
** had to be processed as normal
|
|
9222
|
+
** had to be processed as normal.</dd>
|
|
9145
9223
|
**
|
|
9146
9224
|
** [[SQLITE_STMTSTATUS_MEMUSED]] <dt>SQLITE_STMTSTATUS_MEMUSED</dt>
|
|
9147
9225
|
** <dd>^This is the approximate number of bytes of heap memory
|
|
@@ -9246,9 +9324,9 @@ struct sqlite3_pcache_page {
|
|
|
9246
9324
|
** SQLite will typically create one cache instance for each open database file,
|
|
9247
9325
|
** though this is not guaranteed. ^The
|
|
9248
9326
|
** first parameter, szPage, is the size in bytes of the pages that must
|
|
9249
|
-
** be allocated by the cache. ^szPage will always a power of two. ^The
|
|
9327
|
+
** be allocated by the cache. ^szPage will always be a power of two. ^The
|
|
9250
9328
|
** second parameter szExtra is a number of bytes of extra storage
|
|
9251
|
-
** associated with each page cache entry. ^The szExtra parameter will
|
|
9329
|
+
** associated with each page cache entry. ^The szExtra parameter will be
|
|
9252
9330
|
** a number less than 250. SQLite will use the
|
|
9253
9331
|
** extra szExtra bytes on each page to store metadata about the underlying
|
|
9254
9332
|
** database page on disk. The value passed into szExtra depends
|
|
@@ -9256,17 +9334,17 @@ struct sqlite3_pcache_page {
|
|
|
9256
9334
|
** ^The third argument to xCreate(), bPurgeable, is true if the cache being
|
|
9257
9335
|
** created will be used to cache database pages of a file stored on disk, or
|
|
9258
9336
|
** false if it is used for an in-memory database. The cache implementation
|
|
9259
|
-
** does not have to do anything special based
|
|
9337
|
+
** does not have to do anything special based upon the value of bPurgeable;
|
|
9260
9338
|
** it is purely advisory. ^On a cache where bPurgeable is false, SQLite will
|
|
9261
9339
|
** never invoke xUnpin() except to deliberately delete a page.
|
|
9262
9340
|
** ^In other words, calls to xUnpin() on a cache with bPurgeable set to
|
|
9263
9341
|
** false will always have the "discard" flag set to true.
|
|
9264
|
-
** ^Hence, a cache created with bPurgeable false will
|
|
9342
|
+
** ^Hence, a cache created with bPurgeable set to false will
|
|
9265
9343
|
** never contain any unpinned pages.
|
|
9266
9344
|
**
|
|
9267
9345
|
** [[the xCachesize() page cache method]]
|
|
9268
9346
|
** ^(The xCachesize() method may be called at any time by SQLite to set the
|
|
9269
|
-
** suggested maximum cache-size (number of pages stored
|
|
9347
|
+
** suggested maximum cache-size (number of pages stored) for the cache
|
|
9270
9348
|
** instance passed as the first argument. This is the value configured using
|
|
9271
9349
|
** the SQLite "[PRAGMA cache_size]" command.)^ As with the bPurgeable
|
|
9272
9350
|
** parameter, the implementation is not required to do anything with this
|
|
@@ -9293,12 +9371,12 @@ struct sqlite3_pcache_page {
|
|
|
9293
9371
|
** implementation must return a pointer to the page buffer with its content
|
|
9294
9372
|
** intact. If the requested page is not already in the cache, then the
|
|
9295
9373
|
** cache implementation should use the value of the createFlag
|
|
9296
|
-
** parameter to help it
|
|
9374
|
+
** parameter to help it determine what action to take:
|
|
9297
9375
|
**
|
|
9298
9376
|
** <table border=1 width=85% align=center>
|
|
9299
9377
|
** <tr><th> createFlag <th> Behavior when page is not already in cache
|
|
9300
9378
|
** <tr><td> 0 <td> Do not allocate a new page. Return NULL.
|
|
9301
|
-
** <tr><td> 1 <td> Allocate a new page if it easy and convenient to do so.
|
|
9379
|
+
** <tr><td> 1 <td> Allocate a new page if it is easy and convenient to do so.
|
|
9302
9380
|
** Otherwise return NULL.
|
|
9303
9381
|
** <tr><td> 2 <td> Make every effort to allocate a new page. Only return
|
|
9304
9382
|
** NULL if allocating a new page is effectively impossible.
|
|
@@ -9315,7 +9393,7 @@ struct sqlite3_pcache_page {
|
|
|
9315
9393
|
** as its second argument. If the third parameter, discard, is non-zero,
|
|
9316
9394
|
** then the page must be evicted from the cache.
|
|
9317
9395
|
** ^If the discard parameter is
|
|
9318
|
-
** zero, then the page may be discarded or retained at the discretion of
|
|
9396
|
+
** zero, then the page may be discarded or retained at the discretion of the
|
|
9319
9397
|
** page cache implementation. ^The page cache implementation
|
|
9320
9398
|
** may choose to evict unpinned pages at any time.
|
|
9321
9399
|
**
|
|
@@ -9333,7 +9411,7 @@ struct sqlite3_pcache_page {
|
|
|
9333
9411
|
** When SQLite calls the xTruncate() method, the cache must discard all
|
|
9334
9412
|
** existing cache entries with page numbers (keys) greater than or equal
|
|
9335
9413
|
** to the value of the iLimit parameter passed to xTruncate(). If any
|
|
9336
|
-
** of these pages are pinned, they
|
|
9414
|
+
** of these pages are pinned, they become implicitly unpinned, meaning that
|
|
9337
9415
|
** they can be safely discarded.
|
|
9338
9416
|
**
|
|
9339
9417
|
** [[the xDestroy() page cache method]]
|
|
@@ -9632,7 +9710,7 @@ SQLITE_API int sqlite3_backup_pagecount(sqlite3_backup *p);
|
|
|
9632
9710
|
** application receives an SQLITE_LOCKED error, it may call the
|
|
9633
9711
|
** sqlite3_unlock_notify() method with the blocked connection handle as
|
|
9634
9712
|
** the first argument to register for a callback that will be invoked
|
|
9635
|
-
** when the blocking
|
|
9713
|
+
** when the blocking connection's current transaction is concluded. ^The
|
|
9636
9714
|
** callback is invoked from within the [sqlite3_step] or [sqlite3_close]
|
|
9637
9715
|
** call that concludes the blocking connection's transaction.
|
|
9638
9716
|
**
|
|
@@ -9652,7 +9730,7 @@ SQLITE_API int sqlite3_backup_pagecount(sqlite3_backup *p);
|
|
|
9652
9730
|
** blocked connection already has a registered unlock-notify callback,
|
|
9653
9731
|
** then the new callback replaces the old.)^ ^If sqlite3_unlock_notify() is
|
|
9654
9732
|
** called with a NULL pointer as its second argument, then any existing
|
|
9655
|
-
** unlock-notify callback is canceled. ^The blocked
|
|
9733
|
+
** unlock-notify callback is canceled. ^The blocked connection's
|
|
9656
9734
|
** unlock-notify callback may also be canceled by closing the blocked
|
|
9657
9735
|
** connection using [sqlite3_close()].
|
|
9658
9736
|
**
|
|
@@ -9822,7 +9900,7 @@ SQLITE_API void sqlite3_log(int iErrCode, const char *zFormat, ...);
|
|
|
9822
9900
|
** is the number of pages currently in the write-ahead log file,
|
|
9823
9901
|
** including those that were just committed.
|
|
9824
9902
|
**
|
|
9825
|
-
** The callback function should normally return [SQLITE_OK]. ^If an error
|
|
9903
|
+
** ^The callback function should normally return [SQLITE_OK]. ^If an error
|
|
9826
9904
|
** code is returned, that error will propagate back up through the
|
|
9827
9905
|
** SQLite code base to cause the statement that provoked the callback
|
|
9828
9906
|
** to report an error, though the commit will have still occurred. If the
|
|
@@ -9830,13 +9908,26 @@ SQLITE_API void sqlite3_log(int iErrCode, const char *zFormat, ...);
|
|
|
9830
9908
|
** that does not correspond to any valid SQLite error code, the results
|
|
9831
9909
|
** are undefined.
|
|
9832
9910
|
**
|
|
9833
|
-
** A single database handle may have at most a single write-ahead log
|
|
9834
|
-
** registered at one time. ^Calling [sqlite3_wal_hook()]
|
|
9835
|
-
** previously registered write-ahead
|
|
9836
|
-
**
|
|
9837
|
-
**
|
|
9838
|
-
**
|
|
9839
|
-
**
|
|
9911
|
+
** ^A single database handle may have at most a single write-ahead log
|
|
9912
|
+
** callback registered at one time. ^Calling [sqlite3_wal_hook()]
|
|
9913
|
+
** replaces the default behavior or previously registered write-ahead
|
|
9914
|
+
** log callback.
|
|
9915
|
+
**
|
|
9916
|
+
** ^The return value is a copy of the third parameter from the
|
|
9917
|
+
** previous call, if any, or 0.
|
|
9918
|
+
**
|
|
9919
|
+
** ^The [sqlite3_wal_autocheckpoint()] interface and the
|
|
9920
|
+
** [wal_autocheckpoint pragma] both invoke [sqlite3_wal_hook()] and
|
|
9921
|
+
** will overwrite any prior [sqlite3_wal_hook()] settings.
|
|
9922
|
+
**
|
|
9923
|
+
** ^If a write-ahead log callback is set using this function then
|
|
9924
|
+
** [sqlite3_wal_checkpoint_v2()] or [PRAGMA wal_checkpoint]
|
|
9925
|
+
** should be invoked periodically to keep the write-ahead log file
|
|
9926
|
+
** from growing without bound.
|
|
9927
|
+
**
|
|
9928
|
+
** ^Passing a NULL pointer for the callback disables automatic
|
|
9929
|
+
** checkpointing entirely. To re-enable the default behavior, call
|
|
9930
|
+
** sqlite3_wal_autocheckpoint(db,1000) or use [PRAGMA wal_checkpoint].
|
|
9840
9931
|
*/
|
|
9841
9932
|
SQLITE_API void *sqlite3_wal_hook(
|
|
9842
9933
|
sqlite3*,
|
|
@@ -9853,7 +9944,7 @@ SQLITE_API void *sqlite3_wal_hook(
|
|
|
9853
9944
|
** to automatically [checkpoint]
|
|
9854
9945
|
** after committing a transaction if there are N or
|
|
9855
9946
|
** more frames in the [write-ahead log] file. ^Passing zero or
|
|
9856
|
-
** a negative value as the
|
|
9947
|
+
** a negative value as the N parameter disables automatic
|
|
9857
9948
|
** checkpoints entirely.
|
|
9858
9949
|
**
|
|
9859
9950
|
** ^The callback registered by this function replaces any existing callback
|
|
@@ -9869,9 +9960,10 @@ SQLITE_API void *sqlite3_wal_hook(
|
|
|
9869
9960
|
**
|
|
9870
9961
|
** ^Every new [database connection] defaults to having the auto-checkpoint
|
|
9871
9962
|
** enabled with a threshold of 1000 or [SQLITE_DEFAULT_WAL_AUTOCHECKPOINT]
|
|
9872
|
-
** pages.
|
|
9873
|
-
**
|
|
9874
|
-
**
|
|
9963
|
+
** pages.
|
|
9964
|
+
**
|
|
9965
|
+
** ^The use of this interface is only necessary if the default setting
|
|
9966
|
+
** is found to be suboptimal for a particular application.
|
|
9875
9967
|
*/
|
|
9876
9968
|
SQLITE_API int sqlite3_wal_autocheckpoint(sqlite3 *db, int N);
|
|
9877
9969
|
|
|
@@ -9936,6 +10028,11 @@ SQLITE_API int sqlite3_wal_checkpoint(sqlite3 *db, const char *zDb);
|
|
|
9936
10028
|
** ^This mode works the same way as SQLITE_CHECKPOINT_RESTART with the
|
|
9937
10029
|
** addition that it also truncates the log file to zero bytes just prior
|
|
9938
10030
|
** to a successful return.
|
|
10031
|
+
**
|
|
10032
|
+
** <dt>SQLITE_CHECKPOINT_NOOP<dd>
|
|
10033
|
+
** ^This mode always checkpoints zero frames. The only reason to invoke
|
|
10034
|
+
** a NOOP checkpoint is to access the values returned by
|
|
10035
|
+
** sqlite3_wal_checkpoint_v2() via output parameters *pnLog and *pnCkpt.
|
|
9939
10036
|
** </dl>
|
|
9940
10037
|
**
|
|
9941
10038
|
** ^If pnLog is not NULL, then *pnLog is set to the total number of frames in
|
|
@@ -10006,6 +10103,7 @@ SQLITE_API int sqlite3_wal_checkpoint_v2(
|
|
|
10006
10103
|
** See the [sqlite3_wal_checkpoint_v2()] documentation for details on the
|
|
10007
10104
|
** meaning of each of these checkpoint modes.
|
|
10008
10105
|
*/
|
|
10106
|
+
#define SQLITE_CHECKPOINT_NOOP -1 /* Do no work at all */
|
|
10009
10107
|
#define SQLITE_CHECKPOINT_PASSIVE 0 /* Do as much as possible w/o blocking */
|
|
10010
10108
|
#define SQLITE_CHECKPOINT_FULL 1 /* Wait for writers, then checkpoint */
|
|
10011
10109
|
#define SQLITE_CHECKPOINT_RESTART 2 /* Like FULL but wait for readers */
|
|
@@ -10050,7 +10148,7 @@ SQLITE_API int sqlite3_vtab_config(sqlite3*, int op, ...);
|
|
|
10050
10148
|
** support constraints. In this configuration (which is the default) if
|
|
10051
10149
|
** a call to the [xUpdate] method returns [SQLITE_CONSTRAINT], then the entire
|
|
10052
10150
|
** statement is rolled back as if [ON CONFLICT | OR ABORT] had been
|
|
10053
|
-
** specified as part of the
|
|
10151
|
+
** specified as part of the user's SQL statement, regardless of the actual
|
|
10054
10152
|
** ON CONFLICT mode specified.
|
|
10055
10153
|
**
|
|
10056
10154
|
** If X is non-zero, then the virtual table implementation guarantees
|
|
@@ -10084,7 +10182,7 @@ SQLITE_API int sqlite3_vtab_config(sqlite3*, int op, ...);
|
|
|
10084
10182
|
** [[SQLITE_VTAB_INNOCUOUS]]<dt>SQLITE_VTAB_INNOCUOUS</dt>
|
|
10085
10183
|
** <dd>Calls of the form
|
|
10086
10184
|
** [sqlite3_vtab_config](db,SQLITE_VTAB_INNOCUOUS) from within the
|
|
10087
|
-
**
|
|
10185
|
+
** [xConnect] or [xCreate] methods of a [virtual table] implementation
|
|
10088
10186
|
** identify that virtual table as being safe to use from within triggers
|
|
10089
10187
|
** and views. Conceptually, the SQLITE_VTAB_INNOCUOUS tag means that the
|
|
10090
10188
|
** virtual table can do no serious harm even if it is controlled by a
|
|
@@ -10252,7 +10350,7 @@ SQLITE_API const char *sqlite3_vtab_collation(sqlite3_index_info*,int);
|
|
|
10252
10350
|
** </table>
|
|
10253
10351
|
**
|
|
10254
10352
|
** ^For the purposes of comparing virtual table output values to see if the
|
|
10255
|
-
** values are same value for sorting purposes, two NULL values are considered
|
|
10353
|
+
** values are the same value for sorting purposes, two NULL values are considered
|
|
10256
10354
|
** to be the same. In other words, the comparison operator is "IS"
|
|
10257
10355
|
** (or "IS NOT DISTINCT FROM") and not "==".
|
|
10258
10356
|
**
|
|
@@ -10262,7 +10360,7 @@ SQLITE_API const char *sqlite3_vtab_collation(sqlite3_index_info*,int);
|
|
|
10262
10360
|
**
|
|
10263
10361
|
** ^A virtual table implementation is always free to return rows in any order
|
|
10264
10362
|
** it wants, as long as the "orderByConsumed" flag is not set. ^When the
|
|
10265
|
-
**
|
|
10363
|
+
** "orderByConsumed" flag is unset, the query planner will add extra
|
|
10266
10364
|
** [bytecode] to ensure that the final results returned by the SQL query are
|
|
10267
10365
|
** ordered correctly. The use of the "orderByConsumed" flag and the
|
|
10268
10366
|
** sqlite3_vtab_distinct() interface is merely an optimization. ^Careful
|
|
@@ -10359,7 +10457,7 @@ SQLITE_API int sqlite3_vtab_in(sqlite3_index_info*, int iCons, int bHandle);
|
|
|
10359
10457
|
** sqlite3_vtab_in_next(X,P) should be one of the parameters to the
|
|
10360
10458
|
** xFilter method which invokes these routines, and specifically
|
|
10361
10459
|
** a parameter that was previously selected for all-at-once IN constraint
|
|
10362
|
-
** processing
|
|
10460
|
+
** processing using the [sqlite3_vtab_in()] interface in the
|
|
10363
10461
|
** [xBestIndex|xBestIndex method]. ^(If the X parameter is not
|
|
10364
10462
|
** an xFilter argument that was selected for all-at-once IN constraint
|
|
10365
10463
|
** processing, then these routines return [SQLITE_ERROR].)^
|
|
@@ -10414,7 +10512,7 @@ SQLITE_API int sqlite3_vtab_in_next(sqlite3_value *pVal, sqlite3_value **ppOut);
|
|
|
10414
10512
|
** and only if *V is set to a value. ^The sqlite3_vtab_rhs_value(P,J,V)
|
|
10415
10513
|
** inteface returns SQLITE_NOTFOUND if the right-hand side of the J-th
|
|
10416
10514
|
** constraint is not available. ^The sqlite3_vtab_rhs_value() interface
|
|
10417
|
-
** can return
|
|
10515
|
+
** can return a result code other than SQLITE_OK or SQLITE_NOTFOUND if
|
|
10418
10516
|
** something goes wrong.
|
|
10419
10517
|
**
|
|
10420
10518
|
** The sqlite3_vtab_rhs_value() interface is usually only successful if
|
|
@@ -10442,8 +10540,8 @@ SQLITE_API int sqlite3_vtab_rhs_value(sqlite3_index_info*, int, sqlite3_value **
|
|
|
10442
10540
|
** KEYWORDS: {conflict resolution mode}
|
|
10443
10541
|
**
|
|
10444
10542
|
** These constants are returned by [sqlite3_vtab_on_conflict()] to
|
|
10445
|
-
** inform a [virtual table] implementation
|
|
10446
|
-
**
|
|
10543
|
+
** inform a [virtual table] implementation of the [ON CONFLICT] mode
|
|
10544
|
+
** for the SQL statement being evaluated.
|
|
10447
10545
|
**
|
|
10448
10546
|
** Note that the [SQLITE_IGNORE] constant is also used as a potential
|
|
10449
10547
|
** return value from the [sqlite3_set_authorizer()] callback and that
|
|
@@ -10483,39 +10581,39 @@ SQLITE_API int sqlite3_vtab_rhs_value(sqlite3_index_info*, int, sqlite3_value **
|
|
|
10483
10581
|
** [[SQLITE_SCANSTAT_EST]] <dt>SQLITE_SCANSTAT_EST</dt>
|
|
10484
10582
|
** <dd>^The "double" variable pointed to by the V parameter will be set to the
|
|
10485
10583
|
** query planner's estimate for the average number of rows output from each
|
|
10486
|
-
** iteration of the X-th loop. If the query planner's
|
|
10584
|
+
** iteration of the X-th loop. If the query planner's estimate was accurate,
|
|
10487
10585
|
** then this value will approximate the quotient NVISIT/NLOOP and the
|
|
10488
10586
|
** product of this value for all prior loops with the same SELECTID will
|
|
10489
|
-
** be the NLOOP value for the current loop
|
|
10587
|
+
** be the NLOOP value for the current loop.</dd>
|
|
10490
10588
|
**
|
|
10491
10589
|
** [[SQLITE_SCANSTAT_NAME]] <dt>SQLITE_SCANSTAT_NAME</dt>
|
|
10492
10590
|
** <dd>^The "const char *" variable pointed to by the V parameter will be set
|
|
10493
10591
|
** to a zero-terminated UTF-8 string containing the name of the index or table
|
|
10494
|
-
** used for the X-th loop
|
|
10592
|
+
** used for the X-th loop.</dd>
|
|
10495
10593
|
**
|
|
10496
10594
|
** [[SQLITE_SCANSTAT_EXPLAIN]] <dt>SQLITE_SCANSTAT_EXPLAIN</dt>
|
|
10497
10595
|
** <dd>^The "const char *" variable pointed to by the V parameter will be set
|
|
10498
10596
|
** to a zero-terminated UTF-8 string containing the [EXPLAIN QUERY PLAN]
|
|
10499
|
-
** description for the X-th loop
|
|
10597
|
+
** description for the X-th loop.</dd>
|
|
10500
10598
|
**
|
|
10501
10599
|
** [[SQLITE_SCANSTAT_SELECTID]] <dt>SQLITE_SCANSTAT_SELECTID</dt>
|
|
10502
10600
|
** <dd>^The "int" variable pointed to by the V parameter will be set to the
|
|
10503
10601
|
** id for the X-th query plan element. The id value is unique within the
|
|
10504
10602
|
** statement. The select-id is the same value as is output in the first
|
|
10505
|
-
** column of an [EXPLAIN QUERY PLAN] query
|
|
10603
|
+
** column of an [EXPLAIN QUERY PLAN] query.</dd>
|
|
10506
10604
|
**
|
|
10507
10605
|
** [[SQLITE_SCANSTAT_PARENTID]] <dt>SQLITE_SCANSTAT_PARENTID</dt>
|
|
10508
10606
|
** <dd>The "int" variable pointed to by the V parameter will be set to the
|
|
10509
|
-
**
|
|
10607
|
+
** id of the parent of the current query element, if applicable, or
|
|
10510
10608
|
** to zero if the query element has no parent. This is the same value as
|
|
10511
|
-
** returned in the second column of an [EXPLAIN QUERY PLAN] query
|
|
10609
|
+
** returned in the second column of an [EXPLAIN QUERY PLAN] query.</dd>
|
|
10512
10610
|
**
|
|
10513
10611
|
** [[SQLITE_SCANSTAT_NCYCLE]] <dt>SQLITE_SCANSTAT_NCYCLE</dt>
|
|
10514
10612
|
** <dd>The sqlite3_int64 output value is set to the number of cycles,
|
|
10515
10613
|
** according to the processor time-stamp counter, that elapsed while the
|
|
10516
10614
|
** query element was being processed. This value is not available for
|
|
10517
10615
|
** all query elements - if it is unavailable the output variable is
|
|
10518
|
-
** set to -1
|
|
10616
|
+
** set to -1.</dd>
|
|
10519
10617
|
** </dl>
|
|
10520
10618
|
*/
|
|
10521
10619
|
#define SQLITE_SCANSTAT_NLOOP 0
|
|
@@ -10556,8 +10654,8 @@ SQLITE_API int sqlite3_vtab_rhs_value(sqlite3_index_info*, int, sqlite3_value **
|
|
|
10556
10654
|
** sqlite3_stmt_scanstatus_v2() with a zeroed flags parameter.
|
|
10557
10655
|
**
|
|
10558
10656
|
** Parameter "idx" identifies the specific query element to retrieve statistics
|
|
10559
|
-
** for. Query elements are numbered starting from zero. A value of -1 may
|
|
10560
|
-
**
|
|
10657
|
+
** for. Query elements are numbered starting from zero. A value of -1 may
|
|
10658
|
+
** retrieve statistics for the entire query. ^If idx is out of range
|
|
10561
10659
|
** - less than -1 or greater than or equal to the total number of query
|
|
10562
10660
|
** elements used to implement the statement - a non-zero value is returned and
|
|
10563
10661
|
** the variable that pOut points to is unchanged.
|
|
@@ -10714,8 +10812,8 @@ SQLITE_API int sqlite3_db_cacheflush(sqlite3*);
|
|
|
10714
10812
|
** triggers; and so forth.
|
|
10715
10813
|
**
|
|
10716
10814
|
** When the [sqlite3_blob_write()] API is used to update a blob column,
|
|
10717
|
-
** the pre-update hook is invoked with SQLITE_DELETE
|
|
10718
|
-
**
|
|
10815
|
+
** the pre-update hook is invoked with SQLITE_DELETE, because
|
|
10816
|
+
** the new values are not yet available. In this case, when a
|
|
10719
10817
|
** callback made with op==SQLITE_DELETE is actually a write using the
|
|
10720
10818
|
** sqlite3_blob_write() API, the [sqlite3_preupdate_blobwrite()] returns
|
|
10721
10819
|
** the index of the column being written. In other cases, where the
|
|
@@ -10833,7 +10931,7 @@ typedef struct sqlite3_snapshot {
|
|
|
10833
10931
|
** The [sqlite3_snapshot_get()] interface is only available when the
|
|
10834
10932
|
** [SQLITE_ENABLE_SNAPSHOT] compile-time option is used.
|
|
10835
10933
|
*/
|
|
10836
|
-
SQLITE_API
|
|
10934
|
+
SQLITE_API int sqlite3_snapshot_get(
|
|
10837
10935
|
sqlite3 *db,
|
|
10838
10936
|
const char *zSchema,
|
|
10839
10937
|
sqlite3_snapshot **ppSnapshot
|
|
@@ -10882,7 +10980,7 @@ SQLITE_API SQLITE_EXPERIMENTAL int sqlite3_snapshot_get(
|
|
|
10882
10980
|
** The [sqlite3_snapshot_open()] interface is only available when the
|
|
10883
10981
|
** [SQLITE_ENABLE_SNAPSHOT] compile-time option is used.
|
|
10884
10982
|
*/
|
|
10885
|
-
SQLITE_API
|
|
10983
|
+
SQLITE_API int sqlite3_snapshot_open(
|
|
10886
10984
|
sqlite3 *db,
|
|
10887
10985
|
const char *zSchema,
|
|
10888
10986
|
sqlite3_snapshot *pSnapshot
|
|
@@ -10899,7 +10997,7 @@ SQLITE_API SQLITE_EXPERIMENTAL int sqlite3_snapshot_open(
|
|
|
10899
10997
|
** The [sqlite3_snapshot_free()] interface is only available when the
|
|
10900
10998
|
** [SQLITE_ENABLE_SNAPSHOT] compile-time option is used.
|
|
10901
10999
|
*/
|
|
10902
|
-
SQLITE_API
|
|
11000
|
+
SQLITE_API void sqlite3_snapshot_free(sqlite3_snapshot*);
|
|
10903
11001
|
|
|
10904
11002
|
/*
|
|
10905
11003
|
** CAPI3REF: Compare the ages of two snapshot handles.
|
|
@@ -10926,7 +11024,7 @@ SQLITE_API SQLITE_EXPERIMENTAL void sqlite3_snapshot_free(sqlite3_snapshot*);
|
|
|
10926
11024
|
** This interface is only available if SQLite is compiled with the
|
|
10927
11025
|
** [SQLITE_ENABLE_SNAPSHOT] option.
|
|
10928
11026
|
*/
|
|
10929
|
-
SQLITE_API
|
|
11027
|
+
SQLITE_API int sqlite3_snapshot_cmp(
|
|
10930
11028
|
sqlite3_snapshot *p1,
|
|
10931
11029
|
sqlite3_snapshot *p2
|
|
10932
11030
|
);
|
|
@@ -10954,7 +11052,7 @@ SQLITE_API SQLITE_EXPERIMENTAL int sqlite3_snapshot_cmp(
|
|
|
10954
11052
|
** This interface is only available if SQLite is compiled with the
|
|
10955
11053
|
** [SQLITE_ENABLE_SNAPSHOT] option.
|
|
10956
11054
|
*/
|
|
10957
|
-
SQLITE_API
|
|
11055
|
+
SQLITE_API int sqlite3_snapshot_recover(sqlite3 *db, const char *zDb);
|
|
10958
11056
|
|
|
10959
11057
|
/*
|
|
10960
11058
|
** CAPI3REF: Serialize a database
|
|
@@ -10968,7 +11066,7 @@ SQLITE_API SQLITE_EXPERIMENTAL int sqlite3_snapshot_recover(sqlite3 *db, const c
|
|
|
10968
11066
|
** For an ordinary on-disk database file, the serialization is just a
|
|
10969
11067
|
** copy of the disk file. For an in-memory database or a "TEMP" database,
|
|
10970
11068
|
** the serialization is the same sequence of bytes which would be written
|
|
10971
|
-
** to disk if that database
|
|
11069
|
+
** to disk if that database were backed up to disk.
|
|
10972
11070
|
**
|
|
10973
11071
|
** The usual case is that sqlite3_serialize() copies the serialization of
|
|
10974
11072
|
** the database into memory obtained from [sqlite3_malloc64()] and returns
|
|
@@ -10977,7 +11075,7 @@ SQLITE_API SQLITE_EXPERIMENTAL int sqlite3_snapshot_recover(sqlite3 *db, const c
|
|
|
10977
11075
|
** contains the SQLITE_SERIALIZE_NOCOPY bit, then no memory allocations
|
|
10978
11076
|
** are made, and the sqlite3_serialize() function will return a pointer
|
|
10979
11077
|
** to the contiguous memory representation of the database that SQLite
|
|
10980
|
-
** is currently using for that database, or NULL if
|
|
11078
|
+
** is currently using for that database, or NULL if no such contiguous
|
|
10981
11079
|
** memory representation of the database exists. A contiguous memory
|
|
10982
11080
|
** representation of the database will usually only exist if there has
|
|
10983
11081
|
** been a prior call to [sqlite3_deserialize(D,S,...)] with the same
|
|
@@ -11028,12 +11126,13 @@ SQLITE_API unsigned char *sqlite3_serialize(
|
|
|
11028
11126
|
**
|
|
11029
11127
|
** The sqlite3_deserialize(D,S,P,N,M,F) interface causes the
|
|
11030
11128
|
** [database connection] D to disconnect from database S and then
|
|
11031
|
-
** reopen S as an in-memory database based on the serialization
|
|
11032
|
-
** in P.
|
|
11033
|
-
**
|
|
11034
|
-
** the
|
|
11035
|
-
**
|
|
11036
|
-
**
|
|
11129
|
+
** reopen S as an in-memory database based on the serialization
|
|
11130
|
+
** contained in P. If S is a NULL pointer, the main database is
|
|
11131
|
+
** used. The serialized database P is N bytes in size. M is the size
|
|
11132
|
+
** of the buffer P, which might be larger than N. If M is larger than
|
|
11133
|
+
** N, and the SQLITE_DESERIALIZE_READONLY bit is not set in F, then
|
|
11134
|
+
** SQLite is permitted to add content to the in-memory database as
|
|
11135
|
+
** long as the total size does not exceed M bytes.
|
|
11037
11136
|
**
|
|
11038
11137
|
** If the SQLITE_DESERIALIZE_FREEONCLOSE bit is set in F, then SQLite will
|
|
11039
11138
|
** invoke sqlite3_free() on the serialization buffer when the database
|
|
@@ -11048,7 +11147,7 @@ SQLITE_API unsigned char *sqlite3_serialize(
|
|
|
11048
11147
|
** database is currently in a read transaction or is involved in a backup
|
|
11049
11148
|
** operation.
|
|
11050
11149
|
**
|
|
11051
|
-
** It is not possible to
|
|
11150
|
+
** It is not possible to deserialize into the TEMP database. If the
|
|
11052
11151
|
** S argument to sqlite3_deserialize(D,S,P,N,M,F) is "temp" then the
|
|
11053
11152
|
** function returns SQLITE_ERROR.
|
|
11054
11153
|
**
|
|
@@ -11070,7 +11169,7 @@ SQLITE_API int sqlite3_deserialize(
|
|
|
11070
11169
|
sqlite3 *db, /* The database connection */
|
|
11071
11170
|
const char *zSchema, /* Which DB to reopen with the deserialization */
|
|
11072
11171
|
unsigned char *pData, /* The serialized database content */
|
|
11073
|
-
sqlite3_int64 szDb, /* Number bytes in the deserialization */
|
|
11172
|
+
sqlite3_int64 szDb, /* Number of bytes in the deserialization */
|
|
11074
11173
|
sqlite3_int64 szBuf, /* Total size of buffer pData[] */
|
|
11075
11174
|
unsigned mFlags /* Zero or more SQLITE_DESERIALIZE_* flags */
|
|
11076
11175
|
);
|
|
@@ -11078,7 +11177,7 @@ SQLITE_API int sqlite3_deserialize(
|
|
|
11078
11177
|
/*
|
|
11079
11178
|
** CAPI3REF: Flags for sqlite3_deserialize()
|
|
11080
11179
|
**
|
|
11081
|
-
** The following are allowed values for 6th argument (the F argument) to
|
|
11180
|
+
** The following are allowed values for the 6th argument (the F argument) to
|
|
11082
11181
|
** the [sqlite3_deserialize(D,S,P,N,M,F)] interface.
|
|
11083
11182
|
**
|
|
11084
11183
|
** The SQLITE_DESERIALIZE_FREEONCLOSE means that the database serialization
|
|
@@ -11100,6 +11199,54 @@ SQLITE_API int sqlite3_deserialize(
|
|
|
11100
11199
|
#define SQLITE_DESERIALIZE_RESIZEABLE 2 /* Resize using sqlite3_realloc64() */
|
|
11101
11200
|
#define SQLITE_DESERIALIZE_READONLY 4 /* Database is read-only */
|
|
11102
11201
|
|
|
11202
|
+
/*
|
|
11203
|
+
** CAPI3REF: Bind array values to the CARRAY table-valued function
|
|
11204
|
+
**
|
|
11205
|
+
** The sqlite3_carray_bind(S,I,P,N,F,X) interface binds an array value to
|
|
11206
|
+
** one of the first argument of the [carray() table-valued function]. The
|
|
11207
|
+
** S parameter is a pointer to the [prepared statement] that uses the carray()
|
|
11208
|
+
** functions. I is the parameter index to be bound. P is a pointer to the
|
|
11209
|
+
** array to be bound, and N is the number of eements in the array. The
|
|
11210
|
+
** F argument is one of constants [SQLITE_CARRAY_INT32], [SQLITE_CARRAY_INT64],
|
|
11211
|
+
** [SQLITE_CARRAY_DOUBLE], [SQLITE_CARRAY_TEXT], or [SQLITE_CARRAY_BLOB] to
|
|
11212
|
+
** indicate the datatype of the array being bound. The X argument is not a
|
|
11213
|
+
** NULL pointer, then SQLite will invoke the function X on the P parameter
|
|
11214
|
+
** after it has finished using P, even if the call to
|
|
11215
|
+
** sqlite3_carray_bind() fails. The special-case finalizer
|
|
11216
|
+
** SQLITE_TRANSIENT has no effect here.
|
|
11217
|
+
*/
|
|
11218
|
+
SQLITE_API int sqlite3_carray_bind(
|
|
11219
|
+
sqlite3_stmt *pStmt, /* Statement to be bound */
|
|
11220
|
+
int i, /* Parameter index */
|
|
11221
|
+
void *aData, /* Pointer to array data */
|
|
11222
|
+
int nData, /* Number of data elements */
|
|
11223
|
+
int mFlags, /* CARRAY flags */
|
|
11224
|
+
void (*xDel)(void*) /* Destructor for aData */
|
|
11225
|
+
);
|
|
11226
|
+
|
|
11227
|
+
/*
|
|
11228
|
+
** CAPI3REF: Datatypes for the CARRAY table-valued function
|
|
11229
|
+
**
|
|
11230
|
+
** The fifth argument to the [sqlite3_carray_bind()] interface musts be
|
|
11231
|
+
** one of the following constants, to specify the datatype of the array
|
|
11232
|
+
** that is being bound into the [carray table-valued function].
|
|
11233
|
+
*/
|
|
11234
|
+
#define SQLITE_CARRAY_INT32 0 /* Data is 32-bit signed integers */
|
|
11235
|
+
#define SQLITE_CARRAY_INT64 1 /* Data is 64-bit signed integers */
|
|
11236
|
+
#define SQLITE_CARRAY_DOUBLE 2 /* Data is doubles */
|
|
11237
|
+
#define SQLITE_CARRAY_TEXT 3 /* Data is char* */
|
|
11238
|
+
#define SQLITE_CARRAY_BLOB 4 /* Data is struct iovec */
|
|
11239
|
+
|
|
11240
|
+
/*
|
|
11241
|
+
** Versions of the above #defines that omit the initial SQLITE_, for
|
|
11242
|
+
** legacy compatibility.
|
|
11243
|
+
*/
|
|
11244
|
+
#define CARRAY_INT32 0 /* Data is 32-bit signed integers */
|
|
11245
|
+
#define CARRAY_INT64 1 /* Data is 64-bit signed integers */
|
|
11246
|
+
#define CARRAY_DOUBLE 2 /* Data is doubles */
|
|
11247
|
+
#define CARRAY_TEXT 3 /* Data is char* */
|
|
11248
|
+
#define CARRAY_BLOB 4 /* Data is struct iovec */
|
|
11249
|
+
|
|
11103
11250
|
/*
|
|
11104
11251
|
** Undo the hack that converts floating point types to integer for
|
|
11105
11252
|
** builds on processors without floating point support.
|
|
@@ -12359,14 +12506,32 @@ SQLITE_API void sqlite3changegroup_delete(sqlite3_changegroup*);
|
|
|
12359
12506
|
** update the "main" database attached to handle db with the changes found in
|
|
12360
12507
|
** the changeset passed via the second and third arguments.
|
|
12361
12508
|
**
|
|
12509
|
+
** All changes made by these functions are enclosed in a savepoint transaction.
|
|
12510
|
+
** If any other error (aside from a constraint failure when attempting to
|
|
12511
|
+
** write to the target database) occurs, then the savepoint transaction is
|
|
12512
|
+
** rolled back, restoring the target database to its original state, and an
|
|
12513
|
+
** SQLite error code returned. Additionally, starting with version 3.51.0,
|
|
12514
|
+
** an error code and error message that may be accessed using the
|
|
12515
|
+
** [sqlite3_errcode()] and [sqlite3_errmsg()] APIs are left in the database
|
|
12516
|
+
** handle.
|
|
12517
|
+
**
|
|
12362
12518
|
** The fourth argument (xFilter) passed to these functions is the "filter
|
|
12363
|
-
** callback".
|
|
12364
|
-
**
|
|
12365
|
-
**
|
|
12366
|
-
**
|
|
12367
|
-
**
|
|
12368
|
-
**
|
|
12369
|
-
**
|
|
12519
|
+
** callback". This may be passed NULL, in which case all changes in the
|
|
12520
|
+
** changeset are applied to the database. For sqlite3changeset_apply() and
|
|
12521
|
+
** sqlite3_changeset_apply_v2(), if it is not NULL, then it is invoked once
|
|
12522
|
+
** for each table affected by at least one change in the changeset. In this
|
|
12523
|
+
** case the table name is passed as the second argument, and a copy of
|
|
12524
|
+
** the context pointer passed as the sixth argument to apply() or apply_v2()
|
|
12525
|
+
** as the first. If the "filter callback" returns zero, then no attempt is
|
|
12526
|
+
** made to apply any changes to the table. Otherwise, if the return value is
|
|
12527
|
+
** non-zero, all changes related to the table are attempted.
|
|
12528
|
+
**
|
|
12529
|
+
** For sqlite3_changeset_apply_v3(), the xFilter callback is invoked once
|
|
12530
|
+
** per change. The second argument in this case is an sqlite3_changeset_iter
|
|
12531
|
+
** that may be queried using the usual APIs for the details of the current
|
|
12532
|
+
** change. If the "filter callback" returns zero in this case, then no attempt
|
|
12533
|
+
** is made to apply the current change. If it returns non-zero, the change
|
|
12534
|
+
** is applied.
|
|
12370
12535
|
**
|
|
12371
12536
|
** For each table that is not excluded by the filter callback, this function
|
|
12372
12537
|
** tests that the target database contains a compatible table. A table is
|
|
@@ -12387,11 +12552,11 @@ SQLITE_API void sqlite3changegroup_delete(sqlite3_changegroup*);
|
|
|
12387
12552
|
** one such warning is issued for each table in the changeset.
|
|
12388
12553
|
**
|
|
12389
12554
|
** For each change for which there is a compatible table, an attempt is made
|
|
12390
|
-
** to modify the table contents according to
|
|
12391
|
-
** change. If a change cannot be
|
|
12392
|
-
** function passed as the fifth argument
|
|
12393
|
-
** invoked. A description of exactly when
|
|
12394
|
-
** each type of change is below.
|
|
12555
|
+
** to modify the table contents according to each UPDATE, INSERT or DELETE
|
|
12556
|
+
** change that is not excluded by a filter callback. If a change cannot be
|
|
12557
|
+
** applied cleanly, the conflict handler function passed as the fifth argument
|
|
12558
|
+
** to sqlite3changeset_apply() may be invoked. A description of exactly when
|
|
12559
|
+
** the conflict handler is invoked for each type of change is below.
|
|
12395
12560
|
**
|
|
12396
12561
|
** Unlike the xFilter argument, xConflict may not be passed NULL. The results
|
|
12397
12562
|
** of passing anything other than a valid function pointer as the xConflict
|
|
@@ -12487,12 +12652,6 @@ SQLITE_API void sqlite3changegroup_delete(sqlite3_changegroup*);
|
|
|
12487
12652
|
** This can be used to further customize the application's conflict
|
|
12488
12653
|
** resolution strategy.
|
|
12489
12654
|
**
|
|
12490
|
-
** All changes made by these functions are enclosed in a savepoint transaction.
|
|
12491
|
-
** If any other error (aside from a constraint failure when attempting to
|
|
12492
|
-
** write to the target database) occurs, then the savepoint transaction is
|
|
12493
|
-
** rolled back, restoring the target database to its original state, and an
|
|
12494
|
-
** SQLite error code returned.
|
|
12495
|
-
**
|
|
12496
12655
|
** If the output parameters (ppRebase) and (pnRebase) are non-NULL and
|
|
12497
12656
|
** the input is a changeset (not a patchset), then sqlite3changeset_apply_v2()
|
|
12498
12657
|
** may set (*ppRebase) to point to a "rebase" that may be used with the
|
|
@@ -12542,6 +12701,23 @@ SQLITE_API int sqlite3changeset_apply_v2(
|
|
|
12542
12701
|
void **ppRebase, int *pnRebase, /* OUT: Rebase data */
|
|
12543
12702
|
int flags /* SESSION_CHANGESETAPPLY_* flags */
|
|
12544
12703
|
);
|
|
12704
|
+
SQLITE_API int sqlite3changeset_apply_v3(
|
|
12705
|
+
sqlite3 *db, /* Apply change to "main" db of this handle */
|
|
12706
|
+
int nChangeset, /* Size of changeset in bytes */
|
|
12707
|
+
void *pChangeset, /* Changeset blob */
|
|
12708
|
+
int(*xFilter)(
|
|
12709
|
+
void *pCtx, /* Copy of sixth arg to _apply() */
|
|
12710
|
+
sqlite3_changeset_iter *p /* Handle describing change */
|
|
12711
|
+
),
|
|
12712
|
+
int(*xConflict)(
|
|
12713
|
+
void *pCtx, /* Copy of sixth arg to _apply() */
|
|
12714
|
+
int eConflict, /* DATA, MISSING, CONFLICT, CONSTRAINT */
|
|
12715
|
+
sqlite3_changeset_iter *p /* Handle describing change and conflict */
|
|
12716
|
+
),
|
|
12717
|
+
void *pCtx, /* First argument passed to xConflict */
|
|
12718
|
+
void **ppRebase, int *pnRebase, /* OUT: Rebase data */
|
|
12719
|
+
int flags /* SESSION_CHANGESETAPPLY_* flags */
|
|
12720
|
+
);
|
|
12545
12721
|
|
|
12546
12722
|
/*
|
|
12547
12723
|
** CAPI3REF: Flags for sqlite3changeset_apply_v2
|
|
@@ -12961,6 +13137,23 @@ SQLITE_API int sqlite3changeset_apply_v2_strm(
|
|
|
12961
13137
|
void **ppRebase, int *pnRebase,
|
|
12962
13138
|
int flags
|
|
12963
13139
|
);
|
|
13140
|
+
SQLITE_API int sqlite3changeset_apply_v3_strm(
|
|
13141
|
+
sqlite3 *db, /* Apply change to "main" db of this handle */
|
|
13142
|
+
int (*xInput)(void *pIn, void *pData, int *pnData), /* Input function */
|
|
13143
|
+
void *pIn, /* First arg for xInput */
|
|
13144
|
+
int(*xFilter)(
|
|
13145
|
+
void *pCtx, /* Copy of sixth arg to _apply() */
|
|
13146
|
+
sqlite3_changeset_iter *p
|
|
13147
|
+
),
|
|
13148
|
+
int(*xConflict)(
|
|
13149
|
+
void *pCtx, /* Copy of sixth arg to _apply() */
|
|
13150
|
+
int eConflict, /* DATA, MISSING, CONFLICT, CONSTRAINT */
|
|
13151
|
+
sqlite3_changeset_iter *p /* Handle describing change and conflict */
|
|
13152
|
+
),
|
|
13153
|
+
void *pCtx, /* First argument passed to xConflict */
|
|
13154
|
+
void **ppRebase, int *pnRebase,
|
|
13155
|
+
int flags
|
|
13156
|
+
);
|
|
12964
13157
|
SQLITE_API int sqlite3changeset_concat_strm(
|
|
12965
13158
|
int (*xInputA)(void *pIn, void *pData, int *pnData),
|
|
12966
13159
|
void *pInA,
|