diff options
| author | 2023-09-01 23:26:33 +0200 | |
|---|---|---|
| committer | 2023-09-01 23:26:33 +0200 | |
| commit | a3f3a3094af2dbceb6543368393fc5e8ae5d516e (patch) | |
| tree | 801c6d0f70e602765d93e250e2e635bd6f11f182 /c/sqlite3.h | |
| parent | update to Zig 0.11 (diff) | |
| download | zig-sqlite-a3f3a3094af2dbceb6543368393fc5e8ae5d516e.tar.gz zig-sqlite-a3f3a3094af2dbceb6543368393fc5e8ae5d516e.tar.xz zig-sqlite-a3f3a3094af2dbceb6543368393fc5e8ae5d516e.zip | |
update sqlite to 3.43.0
Diffstat (limited to 'c/sqlite3.h')
| -rw-r--r-- | c/sqlite3.h | 622 |
1 files changed, 453 insertions, 169 deletions
diff --git a/c/sqlite3.h b/c/sqlite3.h index 2868334..ec451a5 100644 --- a/c/sqlite3.h +++ b/c/sqlite3.h | |||
| @@ -146,9 +146,9 @@ extern "C" { | |||
| 146 | ** [sqlite3_libversion_number()], [sqlite3_sourceid()], | 146 | ** [sqlite3_libversion_number()], [sqlite3_sourceid()], |
| 147 | ** [sqlite_version()] and [sqlite_source_id()]. | 147 | ** [sqlite_version()] and [sqlite_source_id()]. |
| 148 | */ | 148 | */ |
| 149 | #define SQLITE_VERSION "3.39.3" | 149 | #define SQLITE_VERSION "3.43.0" |
| 150 | #define SQLITE_VERSION_NUMBER 3039003 | 150 | #define SQLITE_VERSION_NUMBER 3043000 |
| 151 | #define SQLITE_SOURCE_ID "2022-09-05 11:02:23 4635f4a69c8c2a8df242b384a992aea71224e39a2ccab42d8c0b0602f1e826e8" | 151 | #define SQLITE_SOURCE_ID "2023-08-24 12:36:59 0f80b798b3f4b81a7bb4233c58294edd0f1156f36b6ecf5ab8e83631d468778c" |
| 152 | 152 | ||
| 153 | /* | 153 | /* |
| 154 | ** CAPI3REF: Run-Time Library Version Numbers | 154 | ** CAPI3REF: Run-Time Library Version Numbers |
| @@ -528,6 +528,7 @@ SQLITE_API int sqlite3_exec( | |||
| 528 | #define SQLITE_IOERR_ROLLBACK_ATOMIC (SQLITE_IOERR | (31<<8)) | 528 | #define SQLITE_IOERR_ROLLBACK_ATOMIC (SQLITE_IOERR | (31<<8)) |
| 529 | #define SQLITE_IOERR_DATA (SQLITE_IOERR | (32<<8)) | 529 | #define SQLITE_IOERR_DATA (SQLITE_IOERR | (32<<8)) |
| 530 | #define SQLITE_IOERR_CORRUPTFS (SQLITE_IOERR | (33<<8)) | 530 | #define SQLITE_IOERR_CORRUPTFS (SQLITE_IOERR | (33<<8)) |
| 531 | #define SQLITE_IOERR_IN_PAGE (SQLITE_IOERR | (34<<8)) | ||
| 531 | #define SQLITE_LOCKED_SHAREDCACHE (SQLITE_LOCKED | (1<<8)) | 532 | #define SQLITE_LOCKED_SHAREDCACHE (SQLITE_LOCKED | (1<<8)) |
| 532 | #define SQLITE_LOCKED_VTAB (SQLITE_LOCKED | (2<<8)) | 533 | #define SQLITE_LOCKED_VTAB (SQLITE_LOCKED | (2<<8)) |
| 533 | #define SQLITE_BUSY_RECOVERY (SQLITE_BUSY | (1<<8)) | 534 | #define SQLITE_BUSY_RECOVERY (SQLITE_BUSY | (1<<8)) |
| @@ -563,6 +564,7 @@ SQLITE_API int sqlite3_exec( | |||
| 563 | #define SQLITE_CONSTRAINT_DATATYPE (SQLITE_CONSTRAINT |(12<<8)) | 564 | #define SQLITE_CONSTRAINT_DATATYPE (SQLITE_CONSTRAINT |(12<<8)) |
| 564 | #define SQLITE_NOTICE_RECOVER_WAL (SQLITE_NOTICE | (1<<8)) | 565 | #define SQLITE_NOTICE_RECOVER_WAL (SQLITE_NOTICE | (1<<8)) |
| 565 | #define SQLITE_NOTICE_RECOVER_ROLLBACK (SQLITE_NOTICE | (2<<8)) | 566 | #define SQLITE_NOTICE_RECOVER_ROLLBACK (SQLITE_NOTICE | (2<<8)) |
| 567 | #define SQLITE_NOTICE_RBU (SQLITE_NOTICE | (3<<8)) | ||
| 566 | #define SQLITE_WARNING_AUTOINDEX (SQLITE_WARNING | (1<<8)) | 568 | #define SQLITE_WARNING_AUTOINDEX (SQLITE_WARNING | (1<<8)) |
| 567 | #define SQLITE_AUTH_USER (SQLITE_AUTH | (1<<8)) | 569 | #define SQLITE_AUTH_USER (SQLITE_AUTH | (1<<8)) |
| 568 | #define SQLITE_OK_LOAD_PERMANENTLY (SQLITE_OK | (1<<8)) | 570 | #define SQLITE_OK_LOAD_PERMANENTLY (SQLITE_OK | (1<<8)) |
| @@ -670,13 +672,17 @@ SQLITE_API int sqlite3_exec( | |||
| 670 | ** | 672 | ** |
| 671 | ** SQLite uses one of these integer values as the second | 673 | ** SQLite uses one of these integer values as the second |
| 672 | ** argument to calls it makes to the xLock() and xUnlock() methods | 674 | ** argument to calls it makes to the xLock() and xUnlock() methods |
| 673 | ** of an [sqlite3_io_methods] object. | 675 | ** of an [sqlite3_io_methods] object. These values are ordered from |
| 676 | ** lest restrictive to most restrictive. | ||
| 677 | ** | ||
| 678 | ** The argument to xLock() is always SHARED or higher. The argument to | ||
| 679 | ** xUnlock is either SHARED or NONE. | ||
| 674 | */ | 680 | */ |
| 675 | #define SQLITE_LOCK_NONE 0 | 681 | #define SQLITE_LOCK_NONE 0 /* xUnlock() only */ |
| 676 | #define SQLITE_LOCK_SHARED 1 | 682 | #define SQLITE_LOCK_SHARED 1 /* xLock() or xUnlock() */ |
| 677 | #define SQLITE_LOCK_RESERVED 2 | 683 | #define SQLITE_LOCK_RESERVED 2 /* xLock() only */ |
| 678 | #define SQLITE_LOCK_PENDING 3 | 684 | #define SQLITE_LOCK_PENDING 3 /* xLock() only */ |
| 679 | #define SQLITE_LOCK_EXCLUSIVE 4 | 685 | #define SQLITE_LOCK_EXCLUSIVE 4 /* xLock() only */ |
| 680 | 686 | ||
| 681 | /* | 687 | /* |
| 682 | ** CAPI3REF: Synchronization Type Flags | 688 | ** CAPI3REF: Synchronization Type Flags |
| @@ -754,7 +760,14 @@ struct sqlite3_file { | |||
| 754 | ** <li> [SQLITE_LOCK_PENDING], or | 760 | ** <li> [SQLITE_LOCK_PENDING], or |
| 755 | ** <li> [SQLITE_LOCK_EXCLUSIVE]. | 761 | ** <li> [SQLITE_LOCK_EXCLUSIVE]. |
| 756 | ** </ul> | 762 | ** </ul> |
| 757 | ** xLock() increases the lock. xUnlock() decreases the lock. | 763 | ** xLock() upgrades the database file lock. In other words, xLock() moves the |
| 764 | ** database file lock in the direction NONE toward EXCLUSIVE. The argument to | ||
| 765 | ** xLock() is always on of SHARED, RESERVED, PENDING, or EXCLUSIVE, never | ||
| 766 | ** SQLITE_LOCK_NONE. If the database file lock is already at or above the | ||
| 767 | ** requested lock, then the call to xLock() is a no-op. | ||
| 768 | ** xUnlock() downgrades the database file lock to either SHARED or NONE. | ||
| 769 | * If the lock is already at or below the requested lock state, then the call | ||
| 770 | ** to xUnlock() is a no-op. | ||
| 758 | ** The xCheckReservedLock() method checks whether any database connection, | 771 | ** The xCheckReservedLock() method checks whether any database connection, |
| 759 | ** either in this process or in some other process, is holding a RESERVED, | 772 | ** either in this process or in some other process, is holding a RESERVED, |
| 760 | ** PENDING, or EXCLUSIVE lock on the file. It returns true | 773 | ** PENDING, or EXCLUSIVE lock on the file. It returns true |
| @@ -859,9 +872,8 @@ struct sqlite3_io_methods { | |||
| 859 | ** opcode causes the xFileControl method to write the current state of | 872 | ** opcode causes the xFileControl method to write the current state of |
| 860 | ** the lock (one of [SQLITE_LOCK_NONE], [SQLITE_LOCK_SHARED], | 873 | ** the lock (one of [SQLITE_LOCK_NONE], [SQLITE_LOCK_SHARED], |
| 861 | ** [SQLITE_LOCK_RESERVED], [SQLITE_LOCK_PENDING], or [SQLITE_LOCK_EXCLUSIVE]) | 874 | ** [SQLITE_LOCK_RESERVED], [SQLITE_LOCK_PENDING], or [SQLITE_LOCK_EXCLUSIVE]) |
| 862 | ** into an integer that the pArg argument points to. This capability | 875 | ** into an integer that the pArg argument points to. |
| 863 | ** is used during testing and is only available when the SQLITE_TEST | 876 | ** This capability is only available if SQLite is compiled with [SQLITE_DEBUG]. |
| 864 | ** compile-time option is used. | ||
| 865 | ** | 877 | ** |
| 866 | ** <li>[[SQLITE_FCNTL_SIZE_HINT]] | 878 | ** <li>[[SQLITE_FCNTL_SIZE_HINT]] |
| 867 | ** The [SQLITE_FCNTL_SIZE_HINT] opcode is used by SQLite to give the VFS | 879 | ** The [SQLITE_FCNTL_SIZE_HINT] opcode is used by SQLite to give the VFS |
| @@ -1165,7 +1177,6 @@ struct sqlite3_io_methods { | |||
| 1165 | ** in wal mode after the client has finished copying pages from the wal | 1177 | ** in wal mode after the client has finished copying pages from the wal |
| 1166 | ** file to the database file, but before the *-shm file is updated to | 1178 | ** file to the database file, but before the *-shm file is updated to |
| 1167 | ** record the fact that the pages have been checkpointed. | 1179 | ** record the fact that the pages have been checkpointed. |
| 1168 | ** </ul> | ||
| 1169 | ** | 1180 | ** |
| 1170 | ** <li>[[SQLITE_FCNTL_EXTERNAL_READER]] | 1181 | ** <li>[[SQLITE_FCNTL_EXTERNAL_READER]] |
| 1171 | ** The EXPERIMENTAL [SQLITE_FCNTL_EXTERNAL_READER] opcode is used to detect | 1182 | ** The EXPERIMENTAL [SQLITE_FCNTL_EXTERNAL_READER] opcode is used to detect |
| @@ -1178,10 +1189,16 @@ struct sqlite3_io_methods { | |||
| 1178 | ** the database is not a wal-mode db, or if there is no such connection in any | 1189 | ** the database is not a wal-mode db, or if there is no such connection in any |
| 1179 | ** other process. This opcode cannot be used to detect transactions opened | 1190 | ** other process. This opcode cannot be used to detect transactions opened |
| 1180 | ** by clients within the current process, only within other processes. | 1191 | ** by clients within the current process, only within other processes. |
| 1181 | ** </ul> | ||
| 1182 | ** | 1192 | ** |
| 1183 | ** <li>[[SQLITE_FCNTL_CKSM_FILE]] | 1193 | ** <li>[[SQLITE_FCNTL_CKSM_FILE]] |
| 1184 | ** Used by the cksmvfs VFS module only. | 1194 | ** The [SQLITE_FCNTL_CKSM_FILE] opcode is for use internally by the |
| 1195 | ** [checksum VFS shim] only. | ||
| 1196 | ** | ||
| 1197 | ** <li>[[SQLITE_FCNTL_RESET_CACHE]] | ||
| 1198 | ** If there is currently no transaction open on the database, and the | ||
| 1199 | ** database is not a temp db, then the [SQLITE_FCNTL_RESET_CACHE] file-control | ||
| 1200 | ** purges the contents of the in-memory page cache. If there is an open | ||
| 1201 | ** transaction, or if the db is a temp-db, this opcode is a no-op, not an error. | ||
| 1185 | ** </ul> | 1202 | ** </ul> |
| 1186 | */ | 1203 | */ |
| 1187 | #define SQLITE_FCNTL_LOCKSTATE 1 | 1204 | #define SQLITE_FCNTL_LOCKSTATE 1 |
| @@ -1224,6 +1241,7 @@ struct sqlite3_io_methods { | |||
| 1224 | #define SQLITE_FCNTL_CKPT_START 39 | 1241 | #define SQLITE_FCNTL_CKPT_START 39 |
| 1225 | #define SQLITE_FCNTL_EXTERNAL_READER 40 | 1242 | #define SQLITE_FCNTL_EXTERNAL_READER 40 |
| 1226 | #define SQLITE_FCNTL_CKSM_FILE 41 | 1243 | #define SQLITE_FCNTL_CKSM_FILE 41 |
| 1244 | #define SQLITE_FCNTL_RESET_CACHE 42 | ||
| 1227 | 1245 | ||
| 1228 | /* deprecated names */ | 1246 | /* deprecated names */ |
| 1229 | #define SQLITE_GET_LOCKPROXYFILE SQLITE_FCNTL_GET_LOCKPROXYFILE | 1247 | #define SQLITE_GET_LOCKPROXYFILE SQLITE_FCNTL_GET_LOCKPROXYFILE |
| @@ -1254,6 +1272,26 @@ typedef struct sqlite3_mutex sqlite3_mutex; | |||
| 1254 | typedef struct sqlite3_api_routines sqlite3_api_routines; | 1272 | typedef struct sqlite3_api_routines sqlite3_api_routines; |
| 1255 | 1273 | ||
| 1256 | /* | 1274 | /* |
| 1275 | ** CAPI3REF: File Name | ||
| 1276 | ** | ||
| 1277 | ** Type [sqlite3_filename] is used by SQLite to pass filenames to the | ||
| 1278 | ** xOpen method of a [VFS]. It may be cast to (const char*) and treated | ||
| 1279 | ** as a normal, nul-terminated, UTF-8 buffer containing the filename, but | ||
| 1280 | ** may also be passed to special APIs such as: | ||
| 1281 | ** | ||
| 1282 | ** <ul> | ||
| 1283 | ** <li> sqlite3_filename_database() | ||
| 1284 | ** <li> sqlite3_filename_journal() | ||
| 1285 | ** <li> sqlite3_filename_wal() | ||
| 1286 | ** <li> sqlite3_uri_parameter() | ||
| 1287 | ** <li> sqlite3_uri_boolean() | ||
| 1288 | ** <li> sqlite3_uri_int64() | ||
| 1289 | ** <li> sqlite3_uri_key() | ||
| 1290 | ** </ul> | ||
| 1291 | */ | ||
| 1292 | typedef const char *sqlite3_filename; | ||
| 1293 | |||
| 1294 | /* | ||
| 1257 | ** CAPI3REF: OS Interface Object | 1295 | ** CAPI3REF: OS Interface Object |
| 1258 | ** | 1296 | ** |
| 1259 | ** An instance of the sqlite3_vfs object defines the interface between | 1297 | ** An instance of the sqlite3_vfs object defines the interface between |
| @@ -1431,7 +1469,7 @@ struct sqlite3_vfs { | |||
| 1431 | sqlite3_vfs *pNext; /* Next registered VFS */ | 1469 | sqlite3_vfs *pNext; /* Next registered VFS */ |
| 1432 | const char *zName; /* Name of this virtual file system */ | 1470 | const char *zName; /* Name of this virtual file system */ |
| 1433 | void *pAppData; /* Pointer to application-specific data */ | 1471 | void *pAppData; /* Pointer to application-specific data */ |
| 1434 | int (*xOpen)(sqlite3_vfs*, const char *zName, sqlite3_file*, | 1472 | int (*xOpen)(sqlite3_vfs*, sqlite3_filename zName, sqlite3_file*, |
| 1435 | int flags, int *pOutFlags); | 1473 | int flags, int *pOutFlags); |
| 1436 | int (*xDelete)(sqlite3_vfs*, const char *zName, int syncDir); | 1474 | int (*xDelete)(sqlite3_vfs*, const char *zName, int syncDir); |
| 1437 | int (*xAccess)(sqlite3_vfs*, const char *zName, int flags, int *pResOut); | 1475 | int (*xAccess)(sqlite3_vfs*, const char *zName, int flags, int *pResOut); |
| @@ -1618,20 +1656,23 @@ SQLITE_API int sqlite3_os_end(void); | |||
| 1618 | ** must ensure that no other SQLite interfaces are invoked by other | 1656 | ** must ensure that no other SQLite interfaces are invoked by other |
| 1619 | ** threads while sqlite3_config() is running.</b> | 1657 | ** threads while sqlite3_config() is running.</b> |
| 1620 | ** | 1658 | ** |
| 1621 | ** The sqlite3_config() interface | ||
| 1622 | ** may only be invoked prior to library initialization using | ||
| 1623 | ** [sqlite3_initialize()] or after shutdown by [sqlite3_shutdown()]. | ||
| 1624 | ** ^If sqlite3_config() is called after [sqlite3_initialize()] and before | ||
| 1625 | ** [sqlite3_shutdown()] then it will return SQLITE_MISUSE. | ||
| 1626 | ** Note, however, that ^sqlite3_config() can be called as part of the | ||
| 1627 | ** implementation of an application-defined [sqlite3_os_init()]. | ||
| 1628 | ** | ||
| 1629 | ** The first argument to sqlite3_config() is an integer | 1659 | ** The first argument to sqlite3_config() is an integer |
| 1630 | ** [configuration option] that determines | 1660 | ** [configuration option] that determines |
| 1631 | ** what property of SQLite is to be configured. Subsequent arguments | 1661 | ** what property of SQLite is to be configured. Subsequent arguments |
| 1632 | ** vary depending on the [configuration option] | 1662 | ** vary depending on the [configuration option] |
| 1633 | ** in the first argument. | 1663 | ** in the first argument. |
| 1634 | ** | 1664 | ** |
| 1665 | ** For most configuration options, the sqlite3_config() interface | ||
| 1666 | ** may only be invoked prior to library initialization using | ||
| 1667 | ** [sqlite3_initialize()] or after shutdown by [sqlite3_shutdown()]. | ||
| 1668 | ** The exceptional configuration options that may be invoked at any time | ||
| 1669 | ** are called "anytime configuration options". | ||
| 1670 | ** ^If sqlite3_config() is called after [sqlite3_initialize()] and before | ||
| 1671 | ** [sqlite3_shutdown()] with a first argument that is not an anytime | ||
| 1672 | ** configuration option, then the sqlite3_config() call will return SQLITE_MISUSE. | ||
| 1673 | ** Note, however, that ^sqlite3_config() can be called as part of the | ||
| 1674 | ** implementation of an application-defined [sqlite3_os_init()]. | ||
| 1675 | ** | ||
| 1635 | ** ^When a configuration option is set, sqlite3_config() returns [SQLITE_OK]. | 1676 | ** ^When a configuration option is set, sqlite3_config() returns [SQLITE_OK]. |
| 1636 | ** ^If the option is unknown or SQLite is unable to set the option | 1677 | ** ^If the option is unknown or SQLite is unable to set the option |
| 1637 | ** then this routine returns a non-zero [error code]. | 1678 | ** then this routine returns a non-zero [error code]. |
| @@ -1739,6 +1780,23 @@ struct sqlite3_mem_methods { | |||
| 1739 | ** These constants are the available integer configuration options that | 1780 | ** These constants are the available integer configuration options that |
| 1740 | ** can be passed as the first argument to the [sqlite3_config()] interface. | 1781 | ** can be passed as the first argument to the [sqlite3_config()] interface. |
| 1741 | ** | 1782 | ** |
| 1783 | ** Most of the configuration options for sqlite3_config() | ||
| 1784 | ** will only work if invoked prior to [sqlite3_initialize()] or after | ||
| 1785 | ** [sqlite3_shutdown()]. The few exceptions to this rule are called | ||
| 1786 | ** "anytime configuration options". | ||
| 1787 | ** ^Calling [sqlite3_config()] with a first argument that is not an | ||
| 1788 | ** anytime configuration option in between calls to [sqlite3_initialize()] and | ||
| 1789 | ** [sqlite3_shutdown()] is a no-op that returns SQLITE_MISUSE. | ||
| 1790 | ** | ||
| 1791 | ** The set of anytime configuration options can change (by insertions | ||
| 1792 | ** and/or deletions) from one release of SQLite to the next. | ||
| 1793 | ** As of SQLite version 3.42.0, the complete set of anytime configuration | ||
| 1794 | ** options is: | ||
| 1795 | ** <ul> | ||
| 1796 | ** <li> SQLITE_CONFIG_LOG | ||
| 1797 | ** <li> SQLITE_CONFIG_PCACHE_HDRSZ | ||
| 1798 | ** </ul> | ||
| 1799 | ** | ||
| 1742 | ** New configuration options may be added in future releases of SQLite. | 1800 | ** New configuration options may be added in future releases of SQLite. |
| 1743 | ** Existing configuration options might be discontinued. Applications | 1801 | ** Existing configuration options might be discontinued. Applications |
| 1744 | ** should check the return code from [sqlite3_config()] to make sure that | 1802 | ** should check the return code from [sqlite3_config()] to make sure that |
| @@ -2085,28 +2143,28 @@ struct sqlite3_mem_methods { | |||
| 2085 | ** compile-time option is not set, then the default maximum is 1073741824. | 2143 | ** compile-time option is not set, then the default maximum is 1073741824. |
| 2086 | ** </dl> | 2144 | ** </dl> |
| 2087 | */ | 2145 | */ |
| 2088 | #define SQLITE_CONFIG_SINGLETHREAD 1 /* nil */ | 2146 | #define SQLITE_CONFIG_SINGLETHREAD 1 /* nil */ |
| 2089 | #define SQLITE_CONFIG_MULTITHREAD 2 /* nil */ | 2147 | #define SQLITE_CONFIG_MULTITHREAD 2 /* nil */ |
| 2090 | #define SQLITE_CONFIG_SERIALIZED 3 /* nil */ | 2148 | #define SQLITE_CONFIG_SERIALIZED 3 /* nil */ |
| 2091 | #define SQLITE_CONFIG_MALLOC 4 /* sqlite3_mem_methods* */ | 2149 | #define SQLITE_CONFIG_MALLOC 4 /* sqlite3_mem_methods* */ |
| 2092 | #define SQLITE_CONFIG_GETMALLOC 5 /* sqlite3_mem_methods* */ | 2150 | #define SQLITE_CONFIG_GETMALLOC 5 /* sqlite3_mem_methods* */ |
| 2093 | #define SQLITE_CONFIG_SCRATCH 6 /* No longer used */ | 2151 | #define SQLITE_CONFIG_SCRATCH 6 /* No longer used */ |
| 2094 | #define SQLITE_CONFIG_PAGECACHE 7 /* void*, int sz, int N */ | 2152 | #define SQLITE_CONFIG_PAGECACHE 7 /* void*, int sz, int N */ |
| 2095 | #define SQLITE_CONFIG_HEAP 8 /* void*, int nByte, int min */ | 2153 | #define SQLITE_CONFIG_HEAP 8 /* void*, int nByte, int min */ |
| 2096 | #define SQLITE_CONFIG_MEMSTATUS 9 /* boolean */ | 2154 | #define SQLITE_CONFIG_MEMSTATUS 9 /* boolean */ |
| 2097 | #define SQLITE_CONFIG_MUTEX 10 /* sqlite3_mutex_methods* */ | 2155 | #define SQLITE_CONFIG_MUTEX 10 /* sqlite3_mutex_methods* */ |
| 2098 | #define SQLITE_CONFIG_GETMUTEX 11 /* sqlite3_mutex_methods* */ | 2156 | #define SQLITE_CONFIG_GETMUTEX 11 /* sqlite3_mutex_methods* */ |
| 2099 | /* previously SQLITE_CONFIG_CHUNKALLOC 12 which is now unused. */ | 2157 | /* previously SQLITE_CONFIG_CHUNKALLOC 12 which is now unused. */ |
| 2100 | #define SQLITE_CONFIG_LOOKASIDE 13 /* int int */ | 2158 | #define SQLITE_CONFIG_LOOKASIDE 13 /* int int */ |
| 2101 | #define SQLITE_CONFIG_PCACHE 14 /* no-op */ | 2159 | #define SQLITE_CONFIG_PCACHE 14 /* no-op */ |
| 2102 | #define SQLITE_CONFIG_GETPCACHE 15 /* no-op */ | 2160 | #define SQLITE_CONFIG_GETPCACHE 15 /* no-op */ |
| 2103 | #define SQLITE_CONFIG_LOG 16 /* xFunc, void* */ | 2161 | #define SQLITE_CONFIG_LOG 16 /* xFunc, void* */ |
| 2104 | #define SQLITE_CONFIG_URI 17 /* int */ | 2162 | #define SQLITE_CONFIG_URI 17 /* int */ |
| 2105 | #define SQLITE_CONFIG_PCACHE2 18 /* sqlite3_pcache_methods2* */ | 2163 | #define SQLITE_CONFIG_PCACHE2 18 /* sqlite3_pcache_methods2* */ |
| 2106 | #define SQLITE_CONFIG_GETPCACHE2 19 /* sqlite3_pcache_methods2* */ | 2164 | #define SQLITE_CONFIG_GETPCACHE2 19 /* sqlite3_pcache_methods2* */ |
| 2107 | #define SQLITE_CONFIG_COVERING_INDEX_SCAN 20 /* int */ | 2165 | #define SQLITE_CONFIG_COVERING_INDEX_SCAN 20 /* int */ |
| 2108 | #define SQLITE_CONFIG_SQLLOG 21 /* xSqllog, void* */ | 2166 | #define SQLITE_CONFIG_SQLLOG 21 /* xSqllog, void* */ |
| 2109 | #define SQLITE_CONFIG_MMAP_SIZE 22 /* sqlite3_int64, sqlite3_int64 */ | 2167 | #define SQLITE_CONFIG_MMAP_SIZE 22 /* sqlite3_int64, sqlite3_int64 */ |
| 2110 | #define SQLITE_CONFIG_WIN32_HEAPSIZE 23 /* int nByte */ | 2168 | #define SQLITE_CONFIG_WIN32_HEAPSIZE 23 /* int nByte */ |
| 2111 | #define SQLITE_CONFIG_PCACHE_HDRSZ 24 /* int *psz */ | 2169 | #define SQLITE_CONFIG_PCACHE_HDRSZ 24 /* int *psz */ |
| 2112 | #define SQLITE_CONFIG_PMASZ 25 /* unsigned int szPma */ | 2170 | #define SQLITE_CONFIG_PMASZ 25 /* unsigned int szPma */ |
| @@ -2147,7 +2205,7 @@ struct sqlite3_mem_methods { | |||
| 2147 | ** configuration for a database connection can only be changed when that | 2205 | ** configuration for a database connection can only be changed when that |
| 2148 | ** connection is not currently using lookaside memory, or in other words | 2206 | ** connection is not currently using lookaside memory, or in other words |
| 2149 | ** when the "current value" returned by | 2207 | ** when the "current value" returned by |
| 2150 | ** [sqlite3_db_status](D,[SQLITE_CONFIG_LOOKASIDE],...) is zero. | 2208 | ** [sqlite3_db_status](D,[SQLITE_DBSTATUS_LOOKASIDE_USED],...) is zero. |
| 2151 | ** Any attempt to change the lookaside memory configuration when lookaside | 2209 | ** Any attempt to change the lookaside memory configuration when lookaside |
| 2152 | ** memory is in use leaves the configuration unchanged and returns | 2210 | ** memory is in use leaves the configuration unchanged and returns |
| 2153 | ** [SQLITE_BUSY].)^</dd> | 2211 | ** [SQLITE_BUSY].)^</dd> |
| @@ -2297,8 +2355,12 @@ struct sqlite3_mem_methods { | |||
| 2297 | ** <li> sqlite3_db_config(db, SQLITE_DBCONFIG_RESET_DATABASE, 0, 0); | 2355 | ** <li> sqlite3_db_config(db, SQLITE_DBCONFIG_RESET_DATABASE, 0, 0); |
| 2298 | ** </ol> | 2356 | ** </ol> |
| 2299 | ** Because resetting a database is destructive and irreversible, the | 2357 | ** Because resetting a database is destructive and irreversible, the |
| 2300 | ** process requires the use of this obscure API and multiple steps to help | 2358 | ** process requires the use of this obscure API and multiple steps to |
| 2301 | ** ensure that it does not happen by accident. | 2359 | ** help ensure that it does not happen by accident. Because this |
| 2360 | ** feature must be capable of resetting corrupt databases, and | ||
| 2361 | ** shutting down virtual tables may require access to that corrupt | ||
| 2362 | ** storage, the library must abandon any installed virtual tables | ||
| 2363 | ** without calling their xDestroy() methods. | ||
| 2302 | ** | 2364 | ** |
| 2303 | ** [[SQLITE_DBCONFIG_DEFENSIVE]] <dt>SQLITE_DBCONFIG_DEFENSIVE</dt> | 2365 | ** [[SQLITE_DBCONFIG_DEFENSIVE]] <dt>SQLITE_DBCONFIG_DEFENSIVE</dt> |
| 2304 | ** <dd>The SQLITE_DBCONFIG_DEFENSIVE option activates or deactivates the | 2366 | ** <dd>The SQLITE_DBCONFIG_DEFENSIVE option activates or deactivates the |
| @@ -2309,6 +2371,7 @@ struct sqlite3_mem_methods { | |||
| 2309 | ** <ul> | 2371 | ** <ul> |
| 2310 | ** <li> The [PRAGMA writable_schema=ON] statement. | 2372 | ** <li> The [PRAGMA writable_schema=ON] statement. |
| 2311 | ** <li> The [PRAGMA journal_mode=OFF] statement. | 2373 | ** <li> The [PRAGMA journal_mode=OFF] statement. |
| 2374 | ** <li> The [PRAGMA schema_version=N] statement. | ||
| 2312 | ** <li> Writes to the [sqlite_dbpage] virtual table. | 2375 | ** <li> Writes to the [sqlite_dbpage] virtual table. |
| 2313 | ** <li> Direct writes to [shadow tables]. | 2376 | ** <li> Direct writes to [shadow tables]. |
| 2314 | ** </ul> | 2377 | ** </ul> |
| @@ -2336,7 +2399,7 @@ struct sqlite3_mem_methods { | |||
| 2336 | ** </dd> | 2399 | ** </dd> |
| 2337 | ** | 2400 | ** |
| 2338 | ** [[SQLITE_DBCONFIG_DQS_DML]] | 2401 | ** [[SQLITE_DBCONFIG_DQS_DML]] |
| 2339 | ** <dt>SQLITE_DBCONFIG_DQS_DML</td> | 2402 | ** <dt>SQLITE_DBCONFIG_DQS_DML</dt> |
| 2340 | ** <dd>The SQLITE_DBCONFIG_DQS_DML option activates or deactivates | 2403 | ** <dd>The SQLITE_DBCONFIG_DQS_DML option activates or deactivates |
| 2341 | ** the legacy [double-quoted string literal] misfeature for DML statements | 2404 | ** the legacy [double-quoted string literal] misfeature for DML statements |
| 2342 | ** only, that is DELETE, INSERT, SELECT, and UPDATE statements. The | 2405 | ** only, that is DELETE, INSERT, SELECT, and UPDATE statements. The |
| @@ -2345,7 +2408,7 @@ struct sqlite3_mem_methods { | |||
| 2345 | ** </dd> | 2408 | ** </dd> |
| 2346 | ** | 2409 | ** |
| 2347 | ** [[SQLITE_DBCONFIG_DQS_DDL]] | 2410 | ** [[SQLITE_DBCONFIG_DQS_DDL]] |
| 2348 | ** <dt>SQLITE_DBCONFIG_DQS_DDL</td> | 2411 | ** <dt>SQLITE_DBCONFIG_DQS_DDL</dt> |
| 2349 | ** <dd>The SQLITE_DBCONFIG_DQS option activates or deactivates | 2412 | ** <dd>The SQLITE_DBCONFIG_DQS option activates or deactivates |
| 2350 | ** the legacy [double-quoted string literal] misfeature for DDL statements, | 2413 | ** the legacy [double-quoted string literal] misfeature for DDL statements, |
| 2351 | ** such as CREATE TABLE and CREATE INDEX. The | 2414 | ** such as CREATE TABLE and CREATE INDEX. The |
| @@ -2354,7 +2417,7 @@ struct sqlite3_mem_methods { | |||
| 2354 | ** </dd> | 2417 | ** </dd> |
| 2355 | ** | 2418 | ** |
| 2356 | ** [[SQLITE_DBCONFIG_TRUSTED_SCHEMA]] | 2419 | ** [[SQLITE_DBCONFIG_TRUSTED_SCHEMA]] |
| 2357 | ** <dt>SQLITE_DBCONFIG_TRUSTED_SCHEMA</td> | 2420 | ** <dt>SQLITE_DBCONFIG_TRUSTED_SCHEMA</dt> |
| 2358 | ** <dd>The SQLITE_DBCONFIG_TRUSTED_SCHEMA option tells SQLite to | 2421 | ** <dd>The SQLITE_DBCONFIG_TRUSTED_SCHEMA option tells SQLite to |
| 2359 | ** assume that database schemas are untainted by malicious content. | 2422 | ** assume that database schemas are untainted by malicious content. |
| 2360 | ** When the SQLITE_DBCONFIG_TRUSTED_SCHEMA option is disabled, SQLite | 2423 | ** When the SQLITE_DBCONFIG_TRUSTED_SCHEMA option is disabled, SQLite |
| @@ -2374,7 +2437,7 @@ struct sqlite3_mem_methods { | |||
| 2374 | ** </dd> | 2437 | ** </dd> |
| 2375 | ** | 2438 | ** |
| 2376 | ** [[SQLITE_DBCONFIG_LEGACY_FILE_FORMAT]] | 2439 | ** [[SQLITE_DBCONFIG_LEGACY_FILE_FORMAT]] |
| 2377 | ** <dt>SQLITE_DBCONFIG_LEGACY_FILE_FORMAT</td> | 2440 | ** <dt>SQLITE_DBCONFIG_LEGACY_FILE_FORMAT</dt> |
| 2378 | ** <dd>The SQLITE_DBCONFIG_LEGACY_FILE_FORMAT option activates or deactivates | 2441 | ** <dd>The SQLITE_DBCONFIG_LEGACY_FILE_FORMAT option activates or deactivates |
| 2379 | ** the legacy file format flag. When activated, this flag causes all newly | 2442 | ** the legacy file format flag. When activated, this flag causes all newly |
| 2380 | ** created database file to have a schema format version number (the 4-byte | 2443 | ** created database file to have a schema format version number (the 4-byte |
| @@ -2383,7 +2446,7 @@ struct sqlite3_mem_methods { | |||
| 2383 | ** any SQLite version back to 3.0.0 ([dateof:3.0.0]). Without this setting, | 2446 | ** any SQLite version back to 3.0.0 ([dateof:3.0.0]). Without this setting, |
| 2384 | ** newly created databases are generally not understandable by SQLite versions | 2447 | ** newly created databases are generally not understandable by SQLite versions |
| 2385 | ** prior to 3.3.0 ([dateof:3.3.0]). As these words are written, there | 2448 | ** prior to 3.3.0 ([dateof:3.3.0]). As these words are written, there |
| 2386 | ** is now scarcely any need to generated database files that are compatible | 2449 | ** is now scarcely any need to generate database files that are compatible |
| 2387 | ** all the way back to version 3.0.0, and so this setting is of little | 2450 | ** all the way back to version 3.0.0, and so this setting is of little |
| 2388 | ** practical use, but is provided so that SQLite can continue to claim the | 2451 | ** practical use, but is provided so that SQLite can continue to claim the |
| 2389 | ** ability to generate new database files that are compatible with version | 2452 | ** ability to generate new database files that are compatible with version |
| @@ -2392,8 +2455,40 @@ struct sqlite3_mem_methods { | |||
| 2392 | ** the [VACUUM] command will fail with an obscure error when attempting to | 2455 | ** the [VACUUM] command will fail with an obscure error when attempting to |
| 2393 | ** process a table with generated columns and a descending index. This is | 2456 | ** process a table with generated columns and a descending index. This is |
| 2394 | ** not considered a bug since SQLite versions 3.3.0 and earlier do not support | 2457 | ** not considered a bug since SQLite versions 3.3.0 and earlier do not support |
| 2395 | ** either generated columns or decending indexes. | 2458 | ** either generated columns or descending indexes. |
| 2459 | ** </dd> | ||
| 2460 | ** | ||
| 2461 | ** [[SQLITE_DBCONFIG_STMT_SCANSTATUS]] | ||
| 2462 | ** <dt>SQLITE_DBCONFIG_STMT_SCANSTATUS</dt> | ||
| 2463 | ** <dd>The SQLITE_DBCONFIG_STMT_SCANSTATUS option is only useful in | ||
| 2464 | ** SQLITE_ENABLE_STMT_SCANSTATUS builds. In this case, it sets or clears | ||
| 2465 | ** a flag that enables collection of the sqlite3_stmt_scanstatus_v2() | ||
| 2466 | ** statistics. For statistics to be collected, the flag must be set on | ||
| 2467 | ** the database handle both when the SQL statement is prepared and when it | ||
| 2468 | ** is stepped. The flag is set (collection of statistics is enabled) | ||
| 2469 | ** by default. This option takes two arguments: an integer and a pointer to | ||
| 2470 | ** an integer.. The first argument is 1, 0, or -1 to enable, disable, or | ||
| 2471 | ** leave unchanged the statement scanstatus option. If the second argument | ||
| 2472 | ** is not NULL, then the value of the statement scanstatus setting after | ||
| 2473 | ** processing the first argument is written into the integer that the second | ||
| 2474 | ** argument points to. | ||
| 2396 | ** </dd> | 2475 | ** </dd> |
| 2476 | ** | ||
| 2477 | ** [[SQLITE_DBCONFIG_REVERSE_SCANORDER]] | ||
| 2478 | ** <dt>SQLITE_DBCONFIG_REVERSE_SCANORDER</dt> | ||
| 2479 | ** <dd>The SQLITE_DBCONFIG_REVERSE_SCANORDER option changes the default order | ||
| 2480 | ** in which tables and indexes are scanned so that the scans start at the end | ||
| 2481 | ** and work toward the beginning rather than starting at the beginning and | ||
| 2482 | ** working toward the end. Setting SQLITE_DBCONFIG_REVERSE_SCANORDER is the | ||
| 2483 | ** same as setting [PRAGMA reverse_unordered_selects]. This option takes | ||
| 2484 | ** two arguments which are an integer and a pointer to an integer. The first | ||
| 2485 | ** argument is 1, 0, or -1 to enable, disable, or leave unchanged the | ||
| 2486 | ** reverse scan order flag, respectively. If the second argument is not NULL, | ||
| 2487 | ** then 0 or 1 is written into the integer that the second argument points to | ||
| 2488 | ** depending on if the reverse scan order flag is set after processing the | ||
| 2489 | ** first argument. | ||
| 2490 | ** </dd> | ||
| 2491 | ** | ||
| 2397 | ** </dl> | 2492 | ** </dl> |
| 2398 | */ | 2493 | */ |
| 2399 | #define SQLITE_DBCONFIG_MAINDBNAME 1000 /* const char* */ | 2494 | #define SQLITE_DBCONFIG_MAINDBNAME 1000 /* const char* */ |
| @@ -2414,7 +2509,9 @@ struct sqlite3_mem_methods { | |||
| 2414 | #define SQLITE_DBCONFIG_ENABLE_VIEW 1015 /* int int* */ | 2509 | #define SQLITE_DBCONFIG_ENABLE_VIEW 1015 /* int int* */ |
| 2415 | #define SQLITE_DBCONFIG_LEGACY_FILE_FORMAT 1016 /* int int* */ | 2510 | #define SQLITE_DBCONFIG_LEGACY_FILE_FORMAT 1016 /* int int* */ |
| 2416 | #define SQLITE_DBCONFIG_TRUSTED_SCHEMA 1017 /* int int* */ | 2511 | #define SQLITE_DBCONFIG_TRUSTED_SCHEMA 1017 /* int int* */ |
| 2417 | #define SQLITE_DBCONFIG_MAX 1017 /* Largest DBCONFIG */ | 2512 | #define SQLITE_DBCONFIG_STMT_SCANSTATUS 1018 /* int int* */ |
| 2513 | #define SQLITE_DBCONFIG_REVERSE_SCANORDER 1019 /* int int* */ | ||
| 2514 | #define SQLITE_DBCONFIG_MAX 1019 /* Largest DBCONFIG */ | ||
| 2418 | 2515 | ||
| 2419 | /* | 2516 | /* |
| 2420 | ** CAPI3REF: Enable Or Disable Extended Result Codes | 2517 | ** CAPI3REF: Enable Or Disable Extended Result Codes |
| @@ -2636,8 +2733,13 @@ SQLITE_API sqlite3_int64 sqlite3_total_changes64(sqlite3*); | |||
| 2636 | ** ^A call to sqlite3_interrupt(D) that occurs when there are no running | 2733 | ** ^A call to sqlite3_interrupt(D) that occurs when there are no running |
| 2637 | ** SQL statements is a no-op and has no effect on SQL statements | 2734 | ** SQL statements is a no-op and has no effect on SQL statements |
| 2638 | ** that are started after the sqlite3_interrupt() call returns. | 2735 | ** that are started after the sqlite3_interrupt() call returns. |
| 2736 | ** | ||
| 2737 | ** ^The [sqlite3_is_interrupted(D)] interface can be used to determine whether | ||
| 2738 | ** or not an interrupt is currently in effect for [database connection] D. | ||
| 2739 | ** It returns 1 if an interrupt is currently in effect, or 0 otherwise. | ||
| 2639 | */ | 2740 | */ |
| 2640 | SQLITE_API void sqlite3_interrupt(sqlite3*); | 2741 | SQLITE_API void sqlite3_interrupt(sqlite3*); |
| 2742 | SQLITE_API int sqlite3_is_interrupted(sqlite3*); | ||
| 2641 | 2743 | ||
| 2642 | /* | 2744 | /* |
| 2643 | ** CAPI3REF: Determine If An SQL Statement Is Complete | 2745 | ** CAPI3REF: Determine If An SQL Statement Is Complete |
| @@ -3255,8 +3357,8 @@ SQLITE_API SQLITE_DEPRECATED void *sqlite3_profile(sqlite3*, | |||
| 3255 | ** <dd>^An SQLITE_TRACE_PROFILE callback provides approximately the same | 3357 | ** <dd>^An SQLITE_TRACE_PROFILE callback provides approximately the same |
| 3256 | ** information as is provided by the [sqlite3_profile()] callback. | 3358 | ** information as is provided by the [sqlite3_profile()] callback. |
| 3257 | ** ^The P argument is a pointer to the [prepared statement] and the | 3359 | ** ^The P argument is a pointer to the [prepared statement] and the |
| 3258 | ** X argument points to a 64-bit integer which is the estimated of | 3360 | ** X argument points to a 64-bit integer which is approximately |
| 3259 | ** the number of nanosecond that the prepared statement took to run. | 3361 | ** the number of nanoseconds that the prepared statement took to run. |
| 3260 | ** ^The SQLITE_TRACE_PROFILE callback is invoked when the statement finishes. | 3362 | ** ^The SQLITE_TRACE_PROFILE callback is invoked when the statement finishes. |
| 3261 | ** | 3363 | ** |
| 3262 | ** [[SQLITE_TRACE_ROW]] <dt>SQLITE_TRACE_ROW</dt> | 3364 | ** [[SQLITE_TRACE_ROW]] <dt>SQLITE_TRACE_ROW</dt> |
| @@ -3288,8 +3390,10 @@ SQLITE_API SQLITE_DEPRECATED void *sqlite3_profile(sqlite3*, | |||
| 3288 | ** M argument should be the bitwise OR-ed combination of | 3390 | ** M argument should be the bitwise OR-ed combination of |
| 3289 | ** zero or more [SQLITE_TRACE] constants. | 3391 | ** zero or more [SQLITE_TRACE] constants. |
| 3290 | ** | 3392 | ** |
| 3291 | ** ^Each call to either sqlite3_trace() or sqlite3_trace_v2() overrides | 3393 | ** ^Each call to either sqlite3_trace(D,X,P) or sqlite3_trace_v2(D,M,X,P) |
| 3292 | ** (cancels) any prior calls to sqlite3_trace() or sqlite3_trace_v2(). | 3394 | ** overrides (cancels) all prior calls to sqlite3_trace(D,X,P) or |
| 3395 | ** sqlite3_trace_v2(D,M,X,P) for the [database connection] D. Each | ||
| 3396 | ** database connection may have at most one trace callback. | ||
| 3293 | ** | 3397 | ** |
| 3294 | ** ^The X callback is invoked whenever any of the events identified by | 3398 | ** ^The X callback is invoked whenever any of the events identified by |
| 3295 | ** mask M occur. ^The integer return value from the callback is currently | 3399 | ** mask M occur. ^The integer return value from the callback is currently |
| @@ -3319,7 +3423,7 @@ SQLITE_API int sqlite3_trace_v2( | |||
| 3319 | ** | 3423 | ** |
| 3320 | ** ^The sqlite3_progress_handler(D,N,X,P) interface causes the callback | 3424 | ** ^The sqlite3_progress_handler(D,N,X,P) interface causes the callback |
| 3321 | ** function X to be invoked periodically during long running calls to | 3425 | ** function X to be invoked periodically during long running calls to |
| 3322 | ** [sqlite3_exec()], [sqlite3_step()] and [sqlite3_get_table()] for | 3426 | ** [sqlite3_step()] and [sqlite3_prepare()] and similar for |
| 3323 | ** database connection D. An example use for this | 3427 | ** database connection D. An example use for this |
| 3324 | ** interface is to keep a GUI updated during a large query. | 3428 | ** interface is to keep a GUI updated during a large query. |
| 3325 | ** | 3429 | ** |
| @@ -3344,6 +3448,13 @@ SQLITE_API int sqlite3_trace_v2( | |||
| 3344 | ** Note that [sqlite3_prepare_v2()] and [sqlite3_step()] both modify their | 3448 | ** Note that [sqlite3_prepare_v2()] and [sqlite3_step()] both modify their |
| 3345 | ** database connections for the meaning of "modify" in this paragraph. | 3449 | ** database connections for the meaning of "modify" in this paragraph. |
| 3346 | ** | 3450 | ** |
| 3451 | ** The progress handler callback would originally only be invoked from the | ||
| 3452 | ** bytecode engine. It still might be invoked during [sqlite3_prepare()] | ||
| 3453 | ** and similar because those routines might force a reparse of the schema | ||
| 3454 | ** which involves running the bytecode engine. However, beginning with | ||
| 3455 | ** SQLite version 3.41.0, the progress handler callback might also be | ||
| 3456 | ** invoked directly from [sqlite3_prepare()] while analyzing and generating | ||
| 3457 | ** code for complex queries. | ||
| 3347 | */ | 3458 | */ |
| 3348 | SQLITE_API void sqlite3_progress_handler(sqlite3*, int, int(*)(void*), void*); | 3459 | SQLITE_API void sqlite3_progress_handler(sqlite3*, int, int(*)(void*), void*); |
| 3349 | 3460 | ||
| @@ -3380,13 +3491,18 @@ SQLITE_API void sqlite3_progress_handler(sqlite3*, int, int(*)(void*), void*); | |||
| 3380 | ** | 3491 | ** |
| 3381 | ** <dl> | 3492 | ** <dl> |
| 3382 | ** ^(<dt>[SQLITE_OPEN_READONLY]</dt> | 3493 | ** ^(<dt>[SQLITE_OPEN_READONLY]</dt> |
| 3383 | ** <dd>The database is opened in read-only mode. If the database does not | 3494 | ** <dd>The database is opened in read-only mode. If the database does |
| 3384 | ** already exist, an error is returned.</dd>)^ | 3495 | ** not already exist, an error is returned.</dd>)^ |
| 3385 | ** | 3496 | ** |
| 3386 | ** ^(<dt>[SQLITE_OPEN_READWRITE]</dt> | 3497 | ** ^(<dt>[SQLITE_OPEN_READWRITE]</dt> |
| 3387 | ** <dd>The database is opened for reading and writing if possible, or reading | 3498 | ** <dd>The database is opened for reading and writing if possible, or |
| 3388 | ** only if the file is write protected by the operating system. In either | 3499 | ** reading only if the file is write protected by the operating |
| 3389 | ** case the database must already exist, otherwise an error is returned.</dd>)^ | 3500 | ** system. In either case the database must already exist, otherwise |
| 3501 | ** an error is returned. For historical reasons, if opening in | ||
| 3502 | ** read-write mode fails due to OS-level permissions, an attempt is | ||
| 3503 | ** made to open it in read-only mode. [sqlite3_db_readonly()] can be | ||
| 3504 | ** used to determine whether the database is actually | ||
| 3505 | ** read-write.</dd>)^ | ||
| 3390 | ** | 3506 | ** |
| 3391 | ** ^(<dt>[SQLITE_OPEN_READWRITE] | [SQLITE_OPEN_CREATE]</dt> | 3507 | ** ^(<dt>[SQLITE_OPEN_READWRITE] | [SQLITE_OPEN_CREATE]</dt> |
| 3392 | ** <dd>The database is opened for reading and writing, and is created if | 3508 | ** <dd>The database is opened for reading and writing, and is created if |
| @@ -3424,6 +3540,9 @@ SQLITE_API void sqlite3_progress_handler(sqlite3*, int, int(*)(void*), void*); | |||
| 3424 | ** <dd>The database is opened [shared cache] enabled, overriding | 3540 | ** <dd>The database is opened [shared cache] enabled, overriding |
| 3425 | ** the default shared cache setting provided by | 3541 | ** the default shared cache setting provided by |
| 3426 | ** [sqlite3_enable_shared_cache()].)^ | 3542 | ** [sqlite3_enable_shared_cache()].)^ |
| 3543 | ** The [use of shared cache mode is discouraged] and hence shared cache | ||
| 3544 | ** capabilities may be omitted from many builds of SQLite. In such cases, | ||
| 3545 | ** this option is a no-op. | ||
| 3427 | ** | 3546 | ** |
| 3428 | ** ^(<dt>[SQLITE_OPEN_PRIVATECACHE]</dt> | 3547 | ** ^(<dt>[SQLITE_OPEN_PRIVATECACHE]</dt> |
| 3429 | ** <dd>The database is opened [shared cache] disabled, overriding | 3548 | ** <dd>The database is opened [shared cache] disabled, overriding |
| @@ -3439,7 +3558,7 @@ SQLITE_API void sqlite3_progress_handler(sqlite3*, int, int(*)(void*), void*); | |||
| 3439 | ** to return an extended result code.</dd> | 3558 | ** to return an extended result code.</dd> |
| 3440 | ** | 3559 | ** |
| 3441 | ** [[OPEN_NOFOLLOW]] ^(<dt>[SQLITE_OPEN_NOFOLLOW]</dt> | 3560 | ** [[OPEN_NOFOLLOW]] ^(<dt>[SQLITE_OPEN_NOFOLLOW]</dt> |
| 3442 | ** <dd>The database filename is not allowed to be a symbolic link</dd> | 3561 | ** <dd>The database filename is not allowed to contain a symbolic link</dd> |
| 3443 | ** </dl>)^ | 3562 | ** </dl>)^ |
| 3444 | ** | 3563 | ** |
| 3445 | ** If the 3rd parameter to sqlite3_open_v2() is not one of the | 3564 | ** If the 3rd parameter to sqlite3_open_v2() is not one of the |
| @@ -3643,7 +3762,7 @@ SQLITE_API int sqlite3_open_v2( | |||
| 3643 | ** as F) must be one of: | 3762 | ** as F) must be one of: |
| 3644 | ** <ul> | 3763 | ** <ul> |
| 3645 | ** <li> A database filename pointer created by the SQLite core and | 3764 | ** <li> A database filename pointer created by the SQLite core and |
| 3646 | ** passed into the xOpen() method of a VFS implemention, or | 3765 | ** passed into the xOpen() method of a VFS implementation, or |
| 3647 | ** <li> A filename obtained from [sqlite3_db_filename()], or | 3766 | ** <li> A filename obtained from [sqlite3_db_filename()], or |
| 3648 | ** <li> A new filename constructed using [sqlite3_create_filename()]. | 3767 | ** <li> A new filename constructed using [sqlite3_create_filename()]. |
| 3649 | ** </ul> | 3768 | ** </ul> |
| @@ -3698,10 +3817,10 @@ SQLITE_API int sqlite3_open_v2( | |||
| 3698 | ** | 3817 | ** |
| 3699 | ** See the [URI filename] documentation for additional information. | 3818 | ** See the [URI filename] documentation for additional information. |
| 3700 | */ | 3819 | */ |
| 3701 | SQLITE_API const char *sqlite3_uri_parameter(const char *zFilename, const char *zParam); | 3820 | SQLITE_API const char *sqlite3_uri_parameter(sqlite3_filename z, const char *zParam); |
| 3702 | SQLITE_API int sqlite3_uri_boolean(const char *zFile, const char *zParam, int bDefault); | 3821 | SQLITE_API int sqlite3_uri_boolean(sqlite3_filename z, const char *zParam, int bDefault); |
| 3703 | SQLITE_API sqlite3_int64 sqlite3_uri_int64(const char*, const char*, sqlite3_int64); | 3822 | SQLITE_API sqlite3_int64 sqlite3_uri_int64(sqlite3_filename, const char*, sqlite3_int64); |
| 3704 | SQLITE_API const char *sqlite3_uri_key(const char *zFilename, int N); | 3823 | SQLITE_API const char *sqlite3_uri_key(sqlite3_filename z, int N); |
| 3705 | 3824 | ||
| 3706 | /* | 3825 | /* |
| 3707 | ** CAPI3REF: Translate filenames | 3826 | ** CAPI3REF: Translate filenames |
| @@ -3730,9 +3849,9 @@ SQLITE_API const char *sqlite3_uri_key(const char *zFilename, int N); | |||
| 3730 | ** return value from [sqlite3_db_filename()], then the result is | 3849 | ** return value from [sqlite3_db_filename()], then the result is |
| 3731 | ** undefined and is likely a memory access violation. | 3850 | ** undefined and is likely a memory access violation. |
| 3732 | */ | 3851 | */ |
| 3733 | SQLITE_API const char *sqlite3_filename_database(const char*); | 3852 | SQLITE_API const char *sqlite3_filename_database(sqlite3_filename); |
| 3734 | SQLITE_API const char *sqlite3_filename_journal(const char*); | 3853 | SQLITE_API const char *sqlite3_filename_journal(sqlite3_filename); |
| 3735 | SQLITE_API const char *sqlite3_filename_wal(const char*); | 3854 | SQLITE_API const char *sqlite3_filename_wal(sqlite3_filename); |
| 3736 | 3855 | ||
| 3737 | /* | 3856 | /* |
| 3738 | ** CAPI3REF: Database File Corresponding To A Journal | 3857 | ** CAPI3REF: Database File Corresponding To A Journal |
| @@ -3756,7 +3875,7 @@ SQLITE_API sqlite3_file *sqlite3_database_file_object(const char*); | |||
| 3756 | /* | 3875 | /* |
| 3757 | ** CAPI3REF: Create and Destroy VFS Filenames | 3876 | ** CAPI3REF: Create and Destroy VFS Filenames |
| 3758 | ** | 3877 | ** |
| 3759 | ** These interfces are provided for use by [VFS shim] implementations and | 3878 | ** These interfaces are provided for use by [VFS shim] implementations and |
| 3760 | ** are not useful outside of that context. | 3879 | ** are not useful outside of that context. |
| 3761 | ** | 3880 | ** |
| 3762 | ** The sqlite3_create_filename(D,J,W,N,P) allocates memory to hold a version of | 3881 | ** The sqlite3_create_filename(D,J,W,N,P) allocates memory to hold a version of |
| @@ -3798,14 +3917,14 @@ SQLITE_API sqlite3_file *sqlite3_database_file_object(const char*); | |||
| 3798 | ** then the corresponding [sqlite3_module.xClose() method should also be | 3917 | ** then the corresponding [sqlite3_module.xClose() method should also be |
| 3799 | ** invoked prior to calling sqlite3_free_filename(Y). | 3918 | ** invoked prior to calling sqlite3_free_filename(Y). |
| 3800 | */ | 3919 | */ |
| 3801 | SQLITE_API char *sqlite3_create_filename( | 3920 | SQLITE_API sqlite3_filename sqlite3_create_filename( |
| 3802 | const char *zDatabase, | 3921 | const char *zDatabase, |
| 3803 | const char *zJournal, | 3922 | const char *zJournal, |
| 3804 | const char *zWal, | 3923 | const char *zWal, |
| 3805 | int nParam, | 3924 | int nParam, |
| 3806 | const char **azParam | 3925 | const char **azParam |
| 3807 | ); | 3926 | ); |
| 3808 | SQLITE_API void sqlite3_free_filename(char*); | 3927 | SQLITE_API void sqlite3_free_filename(sqlite3_filename); |
| 3809 | 3928 | ||
| 3810 | /* | 3929 | /* |
| 3811 | ** CAPI3REF: Error Codes And Messages | 3930 | ** CAPI3REF: Error Codes And Messages |
| @@ -4304,6 +4423,41 @@ SQLITE_API int sqlite3_stmt_readonly(sqlite3_stmt *pStmt); | |||
| 4304 | SQLITE_API int sqlite3_stmt_isexplain(sqlite3_stmt *pStmt); | 4423 | SQLITE_API int sqlite3_stmt_isexplain(sqlite3_stmt *pStmt); |
| 4305 | 4424 | ||
| 4306 | /* | 4425 | /* |
| 4426 | ** CAPI3REF: Change The EXPLAIN Setting For A Prepared Statement | ||
| 4427 | ** METHOD: sqlite3_stmt | ||
| 4428 | ** | ||
| 4429 | ** The sqlite3_stmt_explain(S,E) interface changes the EXPLAIN | ||
| 4430 | ** setting for [prepared statement] S. If E is zero, then S becomes | ||
| 4431 | ** a normal prepared statement. If E is 1, then S behaves as if | ||
| 4432 | ** its SQL text began with "[EXPLAIN]". If E is 2, then S behaves as if | ||
| 4433 | ** its SQL text began with "[EXPLAIN QUERY PLAN]". | ||
| 4434 | ** | ||
| 4435 | ** Calling sqlite3_stmt_explain(S,E) might cause S to be reprepared. | ||
| 4436 | ** SQLite tries to avoid a reprepare, but a reprepare might be necessary | ||
| 4437 | ** on the first transition into EXPLAIN or EXPLAIN QUERY PLAN mode. | ||
| 4438 | ** | ||
| 4439 | ** Because of the potential need to reprepare, a call to | ||
| 4440 | ** sqlite3_stmt_explain(S,E) will fail with SQLITE_ERROR if S cannot be | ||
| 4441 | ** reprepared because it was created using [sqlite3_prepare()] instead of | ||
| 4442 | ** the newer [sqlite3_prepare_v2()] or [sqlite3_prepare_v3()] interfaces and | ||
| 4443 | ** hence has no saved SQL text with which to reprepare. | ||
| 4444 | ** | ||
| 4445 | ** Changing the explain setting for a prepared statement does not change | ||
| 4446 | ** the original SQL text for the statement. Hence, if the SQL text originally | ||
| 4447 | ** began with EXPLAIN or EXPLAIN QUERY PLAN, but sqlite3_stmt_explain(S,0) | ||
| 4448 | ** is called to convert the statement into an ordinary statement, the EXPLAIN | ||
| 4449 | ** or EXPLAIN QUERY PLAN keywords will still appear in the sqlite3_sql(S) | ||
| 4450 | ** output, even though the statement now acts like a normal SQL statement. | ||
| 4451 | ** | ||
| 4452 | ** This routine returns SQLITE_OK if the explain mode is successfully | ||
| 4453 | ** changed, or an error code if the explain mode could not be changed. | ||
| 4454 | ** The explain mode cannot be changed while a statement is active. | ||
| 4455 | ** Hence, it is good practice to call [sqlite3_reset(S)] | ||
| 4456 | ** immediately prior to calling sqlite3_stmt_explain(S,E). | ||
| 4457 | */ | ||
| 4458 | SQLITE_API int sqlite3_stmt_explain(sqlite3_stmt *pStmt, int eMode); | ||
| 4459 | |||
| 4460 | /* | ||
| 4307 | ** CAPI3REF: Determine If A Prepared Statement Has Been Reset | 4461 | ** CAPI3REF: Determine If A Prepared Statement Has Been Reset |
| 4308 | ** METHOD: sqlite3_stmt | 4462 | ** METHOD: sqlite3_stmt |
| 4309 | ** | 4463 | ** |
| @@ -4466,7 +4620,7 @@ typedef struct sqlite3_context sqlite3_context; | |||
| 4466 | ** with it may be passed. ^It is called to dispose of the BLOB or string even | 4620 | ** with it may be passed. ^It is called to dispose of the BLOB or string even |
| 4467 | ** if the call to the bind API fails, except the destructor is not called if | 4621 | ** if the call to the bind API fails, except the destructor is not called if |
| 4468 | ** the third parameter is a NULL pointer or the fourth parameter is negative. | 4622 | ** the third parameter is a NULL pointer or the fourth parameter is negative. |
| 4469 | ** ^ (2) The special constant, [SQLITE_STATIC], may be passsed to indicate that | 4623 | ** ^ (2) The special constant, [SQLITE_STATIC], may be passed to indicate that |
| 4470 | ** the application remains responsible for disposing of the object. ^In this | 4624 | ** the application remains responsible for disposing of the object. ^In this |
| 4471 | ** case, the object and the provided pointer to it must remain valid until | 4625 | ** case, the object and the provided pointer to it must remain valid until |
| 4472 | ** either the prepared statement is finalized or the same SQL parameter is | 4626 | ** either the prepared statement is finalized or the same SQL parameter is |
| @@ -5145,14 +5299,26 @@ SQLITE_API int sqlite3_finalize(sqlite3_stmt *pStmt); | |||
| 5145 | ** ^The [sqlite3_reset(S)] interface resets the [prepared statement] S | 5299 | ** ^The [sqlite3_reset(S)] interface resets the [prepared statement] S |
| 5146 | ** back to the beginning of its program. | 5300 | ** back to the beginning of its program. |
| 5147 | ** | 5301 | ** |
| 5148 | ** ^If the most recent call to [sqlite3_step(S)] for the | 5302 | ** ^The return code from [sqlite3_reset(S)] indicates whether or not |
| 5149 | ** [prepared statement] S returned [SQLITE_ROW] or [SQLITE_DONE], | 5303 | ** the previous evaluation of prepared statement S completed successfully. |
| 5150 | ** or if [sqlite3_step(S)] has never before been called on S, | 5304 | ** ^If [sqlite3_step(S)] has never before been called on S or if |
| 5151 | ** then [sqlite3_reset(S)] returns [SQLITE_OK]. | 5305 | ** [sqlite3_step(S)] has not been called since the previous call |
| 5306 | ** to [sqlite3_reset(S)], then [sqlite3_reset(S)] will return | ||
| 5307 | ** [SQLITE_OK]. | ||
| 5152 | ** | 5308 | ** |
| 5153 | ** ^If the most recent call to [sqlite3_step(S)] for the | 5309 | ** ^If the most recent call to [sqlite3_step(S)] for the |
| 5154 | ** [prepared statement] S indicated an error, then | 5310 | ** [prepared statement] S indicated an error, then |
| 5155 | ** [sqlite3_reset(S)] returns an appropriate [error code]. | 5311 | ** [sqlite3_reset(S)] returns an appropriate [error code]. |
| 5312 | ** ^The [sqlite3_reset(S)] interface might also return an [error code] | ||
| 5313 | ** if there were no prior errors but the process of resetting | ||
| 5314 | ** the prepared statement caused a new error. ^For example, if an | ||
| 5315 | ** [INSERT] statement with a [RETURNING] clause is only stepped one time, | ||
| 5316 | ** that one call to [sqlite3_step(S)] might return SQLITE_ROW but | ||
| 5317 | ** the overall statement might still fail and the [sqlite3_reset(S)] call | ||
| 5318 | ** might return SQLITE_BUSY if locking constraints prevent the | ||
| 5319 | ** database change from committing. Therefore, it is important that | ||
| 5320 | ** applications check the return code from [sqlite3_reset(S)] even if | ||
| 5321 | ** no prior call to [sqlite3_step(S)] indicated a problem. | ||
| 5156 | ** | 5322 | ** |
| 5157 | ** ^The [sqlite3_reset(S)] interface does not change the values | 5323 | ** ^The [sqlite3_reset(S)] interface does not change the values |
| 5158 | ** of any [sqlite3_bind_blob|bindings] on the [prepared statement] S. | 5324 | ** of any [sqlite3_bind_blob|bindings] on the [prepared statement] S. |
| @@ -5364,10 +5530,21 @@ SQLITE_API int sqlite3_create_window_function( | |||
| 5364 | ** from top-level SQL, and cannot be used in VIEWs or TRIGGERs nor in | 5530 | ** from top-level SQL, and cannot be used in VIEWs or TRIGGERs nor in |
| 5365 | ** schema structures such as [CHECK constraints], [DEFAULT clauses], | 5531 | ** schema structures such as [CHECK constraints], [DEFAULT clauses], |
| 5366 | ** [expression indexes], [partial indexes], or [generated columns]. | 5532 | ** [expression indexes], [partial indexes], or [generated columns]. |
| 5367 | ** The SQLITE_DIRECTONLY flags is a security feature which is recommended | 5533 | ** <p> |
| 5368 | ** for all [application-defined SQL functions], and especially for functions | 5534 | ** The SQLITE_DIRECTONLY flag is recommended for any |
| 5369 | ** that have side-effects or that could potentially leak sensitive | 5535 | ** [application-defined SQL function] |
| 5370 | ** information. | 5536 | ** that has side-effects or that could potentially leak sensitive information. |
| 5537 | ** This will prevent attacks in which an application is tricked | ||
| 5538 | ** into using a database file that has had its schema surreptitiously | ||
| 5539 | ** modified to invoke the application-defined function in ways that are | ||
| 5540 | ** harmful. | ||
| 5541 | ** <p> | ||
| 5542 | ** Some people say it is good practice to set SQLITE_DIRECTONLY on all | ||
| 5543 | ** [application-defined SQL functions], regardless of whether or not they | ||
| 5544 | ** are security sensitive, as doing so prevents those functions from being used | ||
| 5545 | ** inside of the database schema, and thus ensures that the database | ||
| 5546 | ** can be inspected and modified using generic tools (such as the [CLI]) | ||
| 5547 | ** that do not have access to the application-defined functions. | ||
| 5371 | ** </dd> | 5548 | ** </dd> |
| 5372 | ** | 5549 | ** |
| 5373 | ** [[SQLITE_INNOCUOUS]] <dt>SQLITE_INNOCUOUS</dt><dd> | 5550 | ** [[SQLITE_INNOCUOUS]] <dt>SQLITE_INNOCUOUS</dt><dd> |
| @@ -5574,6 +5751,28 @@ SQLITE_API int sqlite3_value_nochange(sqlite3_value*); | |||
| 5574 | SQLITE_API int sqlite3_value_frombind(sqlite3_value*); | 5751 | SQLITE_API int sqlite3_value_frombind(sqlite3_value*); |
| 5575 | 5752 | ||
| 5576 | /* | 5753 | /* |
| 5754 | ** CAPI3REF: Report the internal text encoding state of an sqlite3_value object | ||
| 5755 | ** METHOD: sqlite3_value | ||
| 5756 | ** | ||
| 5757 | ** ^(The sqlite3_value_encoding(X) interface returns one of [SQLITE_UTF8], | ||
| 5758 | ** [SQLITE_UTF16BE], or [SQLITE_UTF16LE] according to the current text encoding | ||
| 5759 | ** of the value X, assuming that X has type TEXT.)^ If sqlite3_value_type(X) | ||
| 5760 | ** returns something other than SQLITE_TEXT, then the return value from | ||
| 5761 | ** sqlite3_value_encoding(X) is meaningless. ^Calls to | ||
| 5762 | ** [sqlite3_value_text(X)], [sqlite3_value_text16(X)], [sqlite3_value_text16be(X)], | ||
| 5763 | ** [sqlite3_value_text16le(X)], [sqlite3_value_bytes(X)], or | ||
| 5764 | ** [sqlite3_value_bytes16(X)] might change the encoding of the value X and | ||
| 5765 | ** thus change the return from subsequent calls to sqlite3_value_encoding(X). | ||
| 5766 | ** | ||
| 5767 | ** This routine is intended for used by applications that test and validate | ||
| 5768 | ** the SQLite implementation. This routine is inquiring about the opaque | ||
| 5769 | ** internal state of an [sqlite3_value] object. Ordinary applications should | ||
| 5770 | ** not need to know what the internal state of an sqlite3_value object is and | ||
| 5771 | ** hence should not need to use this interface. | ||
| 5772 | */ | ||
| 5773 | SQLITE_API int sqlite3_value_encoding(sqlite3_value*); | ||
| 5774 | |||
| 5775 | /* | ||
| 5577 | ** CAPI3REF: Finding The Subtype Of SQL Values | 5776 | ** CAPI3REF: Finding The Subtype Of SQL Values |
| 5578 | ** METHOD: sqlite3_value | 5777 | ** METHOD: sqlite3_value |
| 5579 | ** | 5778 | ** |
| @@ -5625,7 +5824,7 @@ SQLITE_API void sqlite3_value_free(sqlite3_value*); | |||
| 5625 | ** | 5824 | ** |
| 5626 | ** ^The sqlite3_aggregate_context(C,N) routine returns a NULL pointer | 5825 | ** ^The sqlite3_aggregate_context(C,N) routine returns a NULL pointer |
| 5627 | ** when first called if N is less than or equal to zero or if a memory | 5826 | ** when first called if N is less than or equal to zero or if a memory |
| 5628 | ** allocate error occurs. | 5827 | ** allocation error occurs. |
| 5629 | ** | 5828 | ** |
| 5630 | ** ^(The amount of space allocated by sqlite3_aggregate_context(C,N) is | 5829 | ** ^(The amount of space allocated by sqlite3_aggregate_context(C,N) is |
| 5631 | ** determined by the N parameter on first successful call. Changing the | 5830 | ** determined by the N parameter on first successful call. Changing the |
| @@ -5830,9 +6029,10 @@ typedef void (*sqlite3_destructor_type)(void*); | |||
| 5830 | ** of [SQLITE_UTF8], [SQLITE_UTF16], [SQLITE_UTF16BE], or [SQLITE_UTF16LE]. | 6029 | ** of [SQLITE_UTF8], [SQLITE_UTF16], [SQLITE_UTF16BE], or [SQLITE_UTF16LE]. |
| 5831 | ** ^SQLite takes the text result from the application from | 6030 | ** ^SQLite takes the text result from the application from |
| 5832 | ** the 2nd parameter of the sqlite3_result_text* interfaces. | 6031 | ** the 2nd parameter of the sqlite3_result_text* interfaces. |
| 5833 | ** ^If the 3rd parameter to the sqlite3_result_text* interfaces | 6032 | ** ^If the 3rd parameter to any of the sqlite3_result_text* interfaces |
| 5834 | ** is negative, then SQLite takes result text from the 2nd parameter | 6033 | ** other than sqlite3_result_text64() is negative, then SQLite computes |
| 5835 | ** through the first zero character. | 6034 | ** the string length itself by searching the 2nd parameter for the first |
| 6035 | ** zero character. | ||
| 5836 | ** ^If the 3rd parameter to the sqlite3_result_text* interfaces | 6036 | ** ^If the 3rd parameter to the sqlite3_result_text* interfaces |
| 5837 | ** is non-negative, then as many bytes (not characters) of the text | 6037 | ** is non-negative, then as many bytes (not characters) of the text |
| 5838 | ** pointed to by the 2nd parameter are taken as the application-defined | 6038 | ** pointed to by the 2nd parameter are taken as the application-defined |
| @@ -6106,6 +6306,13 @@ SQLITE_API void sqlite3_activate_cerod( | |||
| 6106 | ** of the default VFS is not implemented correctly, or not implemented at | 6306 | ** of the default VFS is not implemented correctly, or not implemented at |
| 6107 | ** all, then the behavior of sqlite3_sleep() may deviate from the description | 6307 | ** all, then the behavior of sqlite3_sleep() may deviate from the description |
| 6108 | ** in the previous paragraphs. | 6308 | ** in the previous paragraphs. |
| 6309 | ** | ||
| 6310 | ** If a negative argument is passed to sqlite3_sleep() the results vary by | ||
| 6311 | ** VFS and operating system. Some system treat a negative argument as an | ||
| 6312 | ** instruction to sleep forever. Others understand it to mean do not sleep | ||
| 6313 | ** at all. ^In SQLite version 3.42.0 and later, a negative | ||
| 6314 | ** argument passed into sqlite3_sleep() is changed to zero before it is relayed | ||
| 6315 | ** down into the xSleep method of the VFS. | ||
| 6109 | */ | 6316 | */ |
| 6110 | SQLITE_API int sqlite3_sleep(int); | 6317 | SQLITE_API int sqlite3_sleep(int); |
| 6111 | 6318 | ||
| @@ -6328,7 +6535,7 @@ SQLITE_API const char *sqlite3_db_name(sqlite3 *db, int N); | |||
| 6328 | ** <li> [sqlite3_filename_wal()] | 6535 | ** <li> [sqlite3_filename_wal()] |
| 6329 | ** </ul> | 6536 | ** </ul> |
| 6330 | */ | 6537 | */ |
| 6331 | SQLITE_API const char *sqlite3_db_filename(sqlite3 *db, const char *zDbName); | 6538 | SQLITE_API sqlite3_filename sqlite3_db_filename(sqlite3 *db, const char *zDbName); |
| 6332 | 6539 | ||
| 6333 | /* | 6540 | /* |
| 6334 | ** CAPI3REF: Determine if a database is read-only | 6541 | ** CAPI3REF: Determine if a database is read-only |
| @@ -6465,7 +6672,7 @@ SQLITE_API void *sqlite3_rollback_hook(sqlite3*, void(*)(void *), void*); | |||
| 6465 | ** function C that is invoked prior to each autovacuum of the database | 6672 | ** function C that is invoked prior to each autovacuum of the database |
| 6466 | ** file. ^The callback is passed a copy of the generic data pointer (P), | 6673 | ** file. ^The callback is passed a copy of the generic data pointer (P), |
| 6467 | ** the schema-name of the attached database that is being autovacuumed, | 6674 | ** the schema-name of the attached database that is being autovacuumed, |
| 6468 | ** the the size of the database file in pages, the number of free pages, | 6675 | ** the size of the database file in pages, the number of free pages, |
| 6469 | ** and the number of bytes per page, respectively. The callback should | 6676 | ** and the number of bytes per page, respectively. The callback should |
| 6470 | ** return the number of free pages that should be removed by the | 6677 | ** return the number of free pages that should be removed by the |
| 6471 | ** autovacuum. ^If the callback returns zero, then no autovacuum happens. | 6678 | ** autovacuum. ^If the callback returns zero, then no autovacuum happens. |
| @@ -6586,6 +6793,11 @@ SQLITE_API void *sqlite3_update_hook( | |||
| 6586 | ** to the same database. Sharing is enabled if the argument is true | 6793 | ** to the same database. Sharing is enabled if the argument is true |
| 6587 | ** and disabled if the argument is false.)^ | 6794 | ** and disabled if the argument is false.)^ |
| 6588 | ** | 6795 | ** |
| 6796 | ** This interface is omitted if SQLite is compiled with | ||
| 6797 | ** [-DSQLITE_OMIT_SHARED_CACHE]. The [-DSQLITE_OMIT_SHARED_CACHE] | ||
| 6798 | ** compile-time option is recommended because the | ||
| 6799 | ** [use of shared cache mode is discouraged]. | ||
| 6800 | ** | ||
| 6589 | ** ^Cache sharing is enabled and disabled for an entire process. | 6801 | ** ^Cache sharing is enabled and disabled for an entire process. |
| 6590 | ** This is a change as of SQLite [version 3.5.0] ([dateof:3.5.0]). | 6802 | ** This is a change as of SQLite [version 3.5.0] ([dateof:3.5.0]). |
| 6591 | ** In prior versions of SQLite, | 6803 | ** In prior versions of SQLite, |
| @@ -6684,7 +6896,7 @@ SQLITE_API int sqlite3_db_release_memory(sqlite3*); | |||
| 6684 | ** ^The soft heap limit may not be greater than the hard heap limit. | 6896 | ** ^The soft heap limit may not be greater than the hard heap limit. |
| 6685 | ** ^If the hard heap limit is enabled and if sqlite3_soft_heap_limit(N) | 6897 | ** ^If the hard heap limit is enabled and if sqlite3_soft_heap_limit(N) |
| 6686 | ** is invoked with a value of N that is greater than the hard heap limit, | 6898 | ** is invoked with a value of N that is greater than the hard heap limit, |
| 6687 | ** the the soft heap limit is set to the value of the hard heap limit. | 6899 | ** the soft heap limit is set to the value of the hard heap limit. |
| 6688 | ** ^The soft heap limit is automatically enabled whenever the hard heap | 6900 | ** ^The soft heap limit is automatically enabled whenever the hard heap |
| 6689 | ** limit is enabled. ^When sqlite3_hard_heap_limit64(N) is invoked and | 6901 | ** limit is enabled. ^When sqlite3_hard_heap_limit64(N) is invoked and |
| 6690 | ** the soft heap limit is outside the range of 1..N, then the soft heap | 6902 | ** the soft heap limit is outside the range of 1..N, then the soft heap |
| @@ -6946,15 +7158,6 @@ SQLITE_API int sqlite3_cancel_auto_extension(void(*xEntryPoint)(void)); | |||
| 6946 | SQLITE_API void sqlite3_reset_auto_extension(void); | 7158 | SQLITE_API void sqlite3_reset_auto_extension(void); |
| 6947 | 7159 | ||
| 6948 | /* | 7160 | /* |
| 6949 | ** The interface to the virtual-table mechanism is currently considered | ||
| 6950 | ** to be experimental. The interface might change in incompatible ways. | ||
| 6951 | ** If this is a problem for you, do not use the interface at this time. | ||
| 6952 | ** | ||
| 6953 | ** When the virtual-table mechanism stabilizes, we will declare the | ||
| 6954 | ** interface fixed, support it indefinitely, and remove this comment. | ||
| 6955 | */ | ||
| 6956 | |||
| 6957 | /* | ||
| 6958 | ** Structures used by the virtual table interface | 7161 | ** Structures used by the virtual table interface |
| 6959 | */ | 7162 | */ |
| 6960 | typedef struct sqlite3_vtab sqlite3_vtab; | 7163 | typedef struct sqlite3_vtab sqlite3_vtab; |
| @@ -7072,10 +7275,10 @@ struct sqlite3_module { | |||
| 7072 | ** when the omit flag is true there is no guarantee that the constraint will | 7275 | ** when the omit flag is true there is no guarantee that the constraint will |
| 7073 | ** not be checked again using byte code.)^ | 7276 | ** not be checked again using byte code.)^ |
| 7074 | ** | 7277 | ** |
| 7075 | ** ^The idxNum and idxPtr values are recorded and passed into the | 7278 | ** ^The idxNum and idxStr values are recorded and passed into the |
| 7076 | ** [xFilter] method. | 7279 | ** [xFilter] method. |
| 7077 | ** ^[sqlite3_free()] is used to free idxPtr if and only if | 7280 | ** ^[sqlite3_free()] is used to free idxStr if and only if |
| 7078 | ** needToFreeIdxPtr is true. | 7281 | ** needToFreeIdxStr is true. |
| 7079 | ** | 7282 | ** |
| 7080 | ** ^The orderByConsumed means that output from [xFilter]/[xNext] will occur in | 7283 | ** ^The orderByConsumed means that output from [xFilter]/[xNext] will occur in |
| 7081 | ** the correct order to satisfy the ORDER BY clause so that no separate | 7284 | ** the correct order to satisfy the ORDER BY clause so that no separate |
| @@ -7195,7 +7398,7 @@ struct sqlite3_index_info { | |||
| 7195 | ** the [sqlite3_vtab_collation()] interface. For most real-world virtual | 7398 | ** the [sqlite3_vtab_collation()] interface. For most real-world virtual |
| 7196 | ** tables, the collating sequence of constraints does not matter (for example | 7399 | ** tables, the collating sequence of constraints does not matter (for example |
| 7197 | ** because the constraints are numeric) and so the sqlite3_vtab_collation() | 7400 | ** because the constraints are numeric) and so the sqlite3_vtab_collation() |
| 7198 | ** interface is no commonly needed. | 7401 | ** interface is not commonly needed. |
| 7199 | */ | 7402 | */ |
| 7200 | #define SQLITE_INDEX_CONSTRAINT_EQ 2 | 7403 | #define SQLITE_INDEX_CONSTRAINT_EQ 2 |
| 7201 | #define SQLITE_INDEX_CONSTRAINT_GT 4 | 7404 | #define SQLITE_INDEX_CONSTRAINT_GT 4 |
| @@ -7355,16 +7558,6 @@ SQLITE_API int sqlite3_declare_vtab(sqlite3*, const char *zSQL); | |||
| 7355 | SQLITE_API int sqlite3_overload_function(sqlite3*, const char *zFuncName, int nArg); | 7558 | SQLITE_API int sqlite3_overload_function(sqlite3*, const char *zFuncName, int nArg); |
| 7356 | 7559 | ||
| 7357 | /* | 7560 | /* |
| 7358 | ** The interface to the virtual-table mechanism defined above (back up | ||
| 7359 | ** to a comment remarkably similar to this one) is currently considered | ||
| 7360 | ** to be experimental. The interface might change in incompatible ways. | ||
| 7361 | ** If this is a problem for you, do not use the interface at this time. | ||
| 7362 | ** | ||
| 7363 | ** When the virtual-table mechanism stabilizes, we will declare the | ||
| 7364 | ** interface fixed, support it indefinitely, and remove this comment. | ||
| 7365 | */ | ||
| 7366 | |||
| 7367 | /* | ||
| 7368 | ** CAPI3REF: A Handle To An Open BLOB | 7561 | ** CAPI3REF: A Handle To An Open BLOB |
| 7369 | ** KEYWORDS: {BLOB handle} {BLOB handles} | 7562 | ** KEYWORDS: {BLOB handle} {BLOB handles} |
| 7370 | ** | 7563 | ** |
| @@ -7747,9 +7940,9 @@ SQLITE_API int sqlite3_vfs_unregister(sqlite3_vfs*); | |||
| 7747 | ** is undefined if the mutex is not currently entered by the | 7940 | ** is undefined if the mutex is not currently entered by the |
| 7748 | ** calling thread or is not currently allocated. | 7941 | ** calling thread or is not currently allocated. |
| 7749 | ** | 7942 | ** |
| 7750 | ** ^If the argument to sqlite3_mutex_enter(), sqlite3_mutex_try(), or | 7943 | ** ^If the argument to sqlite3_mutex_enter(), sqlite3_mutex_try(), |
| 7751 | ** sqlite3_mutex_leave() is a NULL pointer, then all three routines | 7944 | ** sqlite3_mutex_leave(), or sqlite3_mutex_free() is a NULL pointer, |
| 7752 | ** behave as no-ops. | 7945 | ** then any of the four routines behaves as a no-op. |
| 7753 | ** | 7946 | ** |
| 7754 | ** See also: [sqlite3_mutex_held()] and [sqlite3_mutex_notheld()]. | 7947 | ** See also: [sqlite3_mutex_held()] and [sqlite3_mutex_notheld()]. |
| 7755 | */ | 7948 | */ |
| @@ -8019,7 +8212,8 @@ SQLITE_API int sqlite3_test_control(int op, ...); | |||
| 8019 | #define SQLITE_TESTCTRL_TRACEFLAGS 31 | 8212 | #define SQLITE_TESTCTRL_TRACEFLAGS 31 |
| 8020 | #define SQLITE_TESTCTRL_TUNE 32 | 8213 | #define SQLITE_TESTCTRL_TUNE 32 |
| 8021 | #define SQLITE_TESTCTRL_LOGEST 33 | 8214 | #define SQLITE_TESTCTRL_LOGEST 33 |
| 8022 | #define SQLITE_TESTCTRL_LAST 33 /* Largest TESTCTRL */ | 8215 | #define SQLITE_TESTCTRL_USELONGDOUBLE 34 |
| 8216 | #define SQLITE_TESTCTRL_LAST 34 /* Largest TESTCTRL */ | ||
| 8023 | 8217 | ||
| 8024 | /* | 8218 | /* |
| 8025 | ** CAPI3REF: SQL Keyword Checking | 8219 | ** CAPI3REF: SQL Keyword Checking |
| @@ -8979,7 +9173,7 @@ typedef struct sqlite3_backup sqlite3_backup; | |||
| 8979 | ** if the application incorrectly accesses the destination [database connection] | 9173 | ** if the application incorrectly accesses the destination [database connection] |
| 8980 | ** and so no error code is reported, but the operations may malfunction | 9174 | ** and so no error code is reported, but the operations may malfunction |
| 8981 | ** nevertheless. Use of the destination database connection while a | 9175 | ** nevertheless. Use of the destination database connection while a |
| 8982 | ** backup is in progress might also also cause a mutex deadlock. | 9176 | ** backup is in progress might also cause a mutex deadlock. |
| 8983 | ** | 9177 | ** |
| 8984 | ** If running in [shared cache mode], the application must | 9178 | ** If running in [shared cache mode], the application must |
| 8985 | ** guarantee that the shared cache used by the destination database | 9179 | ** guarantee that the shared cache used by the destination database |
| @@ -9051,8 +9245,8 @@ SQLITE_API int sqlite3_backup_pagecount(sqlite3_backup *p); | |||
| 9051 | ** blocked connection already has a registered unlock-notify callback, | 9245 | ** blocked connection already has a registered unlock-notify callback, |
| 9052 | ** then the new callback replaces the old.)^ ^If sqlite3_unlock_notify() is | 9246 | ** then the new callback replaces the old.)^ ^If sqlite3_unlock_notify() is |
| 9053 | ** called with a NULL pointer as its second argument, then any existing | 9247 | ** called with a NULL pointer as its second argument, then any existing |
| 9054 | ** unlock-notify callback is canceled. ^The blocked connections | 9248 | ** unlock-notify callback is cancelled. ^The blocked connections |
| 9055 | ** unlock-notify callback may also be canceled by closing the blocked | 9249 | ** unlock-notify callback may also be cancelled by closing the blocked |
| 9056 | ** connection using [sqlite3_close()]. | 9250 | ** connection using [sqlite3_close()]. |
| 9057 | ** | 9251 | ** |
| 9058 | ** The unlock-notify callback is not reentrant. If an application invokes | 9252 | ** The unlock-notify callback is not reentrant. If an application invokes |
| @@ -9407,7 +9601,7 @@ SQLITE_API int sqlite3_wal_checkpoint_v2( | |||
| 9407 | */ | 9601 | */ |
| 9408 | #define SQLITE_CHECKPOINT_PASSIVE 0 /* Do as much as possible w/o blocking */ | 9602 | #define SQLITE_CHECKPOINT_PASSIVE 0 /* Do as much as possible w/o blocking */ |
| 9409 | #define SQLITE_CHECKPOINT_FULL 1 /* Wait for writers, then checkpoint */ | 9603 | #define SQLITE_CHECKPOINT_FULL 1 /* Wait for writers, then checkpoint */ |
| 9410 | #define SQLITE_CHECKPOINT_RESTART 2 /* Like FULL but wait for for readers */ | 9604 | #define SQLITE_CHECKPOINT_RESTART 2 /* Like FULL but wait for readers */ |
| 9411 | #define SQLITE_CHECKPOINT_TRUNCATE 3 /* Like RESTART but also truncate WAL */ | 9605 | #define SQLITE_CHECKPOINT_TRUNCATE 3 /* Like RESTART but also truncate WAL */ |
| 9412 | 9606 | ||
| 9413 | /* | 9607 | /* |
| @@ -9475,7 +9669,7 @@ SQLITE_API int sqlite3_vtab_config(sqlite3*, int op, ...); | |||
| 9475 | ** [[SQLITE_VTAB_DIRECTONLY]]<dt>SQLITE_VTAB_DIRECTONLY</dt> | 9669 | ** [[SQLITE_VTAB_DIRECTONLY]]<dt>SQLITE_VTAB_DIRECTONLY</dt> |
| 9476 | ** <dd>Calls of the form | 9670 | ** <dd>Calls of the form |
| 9477 | ** [sqlite3_vtab_config](db,SQLITE_VTAB_DIRECTONLY) from within the | 9671 | ** [sqlite3_vtab_config](db,SQLITE_VTAB_DIRECTONLY) from within the |
| 9478 | ** the [xConnect] or [xCreate] methods of a [virtual table] implmentation | 9672 | ** the [xConnect] or [xCreate] methods of a [virtual table] implementation |
| 9479 | ** prohibits that virtual table from being used from within triggers and | 9673 | ** prohibits that virtual table from being used from within triggers and |
| 9480 | ** views. | 9674 | ** views. |
| 9481 | ** </dd> | 9675 | ** </dd> |
| @@ -9483,18 +9677,28 @@ SQLITE_API int sqlite3_vtab_config(sqlite3*, int op, ...); | |||
| 9483 | ** [[SQLITE_VTAB_INNOCUOUS]]<dt>SQLITE_VTAB_INNOCUOUS</dt> | 9677 | ** [[SQLITE_VTAB_INNOCUOUS]]<dt>SQLITE_VTAB_INNOCUOUS</dt> |
| 9484 | ** <dd>Calls of the form | 9678 | ** <dd>Calls of the form |
| 9485 | ** [sqlite3_vtab_config](db,SQLITE_VTAB_INNOCUOUS) from within the | 9679 | ** [sqlite3_vtab_config](db,SQLITE_VTAB_INNOCUOUS) from within the |
| 9486 | ** the [xConnect] or [xCreate] methods of a [virtual table] implmentation | 9680 | ** the [xConnect] or [xCreate] methods of a [virtual table] implementation |
| 9487 | ** identify that virtual table as being safe to use from within triggers | 9681 | ** identify that virtual table as being safe to use from within triggers |
| 9488 | ** and views. Conceptually, the SQLITE_VTAB_INNOCUOUS tag means that the | 9682 | ** and views. Conceptually, the SQLITE_VTAB_INNOCUOUS tag means that the |
| 9489 | ** virtual table can do no serious harm even if it is controlled by a | 9683 | ** virtual table can do no serious harm even if it is controlled by a |
| 9490 | ** malicious hacker. Developers should avoid setting the SQLITE_VTAB_INNOCUOUS | 9684 | ** malicious hacker. Developers should avoid setting the SQLITE_VTAB_INNOCUOUS |
| 9491 | ** flag unless absolutely necessary. | 9685 | ** flag unless absolutely necessary. |
| 9492 | ** </dd> | 9686 | ** </dd> |
| 9687 | ** | ||
| 9688 | ** [[SQLITE_VTAB_USES_ALL_SCHEMAS]]<dt>SQLITE_VTAB_USES_ALL_SCHEMAS</dt> | ||
| 9689 | ** <dd>Calls of the form | ||
| 9690 | ** [sqlite3_vtab_config](db,SQLITE_VTAB_USES_ALL_SCHEMA) from within the | ||
| 9691 | ** the [xConnect] or [xCreate] methods of a [virtual table] implementation | ||
| 9692 | ** instruct the query planner to begin at least a read transaction on | ||
| 9693 | ** all schemas ("main", "temp", and any ATTACH-ed databases) whenever the | ||
| 9694 | ** virtual table is used. | ||
| 9695 | ** </dd> | ||
| 9493 | ** </dl> | 9696 | ** </dl> |
| 9494 | */ | 9697 | */ |
| 9495 | #define SQLITE_VTAB_CONSTRAINT_SUPPORT 1 | 9698 | #define SQLITE_VTAB_CONSTRAINT_SUPPORT 1 |
| 9496 | #define SQLITE_VTAB_INNOCUOUS 2 | 9699 | #define SQLITE_VTAB_INNOCUOUS 2 |
| 9497 | #define SQLITE_VTAB_DIRECTONLY 3 | 9700 | #define SQLITE_VTAB_DIRECTONLY 3 |
| 9701 | #define SQLITE_VTAB_USES_ALL_SCHEMAS 4 | ||
| 9498 | 9702 | ||
| 9499 | /* | 9703 | /* |
| 9500 | ** CAPI3REF: Determine The Virtual Table Conflict Policy | 9704 | ** CAPI3REF: Determine The Virtual Table Conflict Policy |
| @@ -9567,7 +9771,7 @@ SQLITE_API int sqlite3_vtab_nochange(sqlite3_context*); | |||
| 9567 | ** <li><p> Otherwise, "BINARY" is returned. | 9771 | ** <li><p> Otherwise, "BINARY" is returned. |
| 9568 | ** </ol> | 9772 | ** </ol> |
| 9569 | */ | 9773 | */ |
| 9570 | SQLITE_API SQLITE_EXPERIMENTAL const char *sqlite3_vtab_collation(sqlite3_index_info*,int); | 9774 | SQLITE_API const char *sqlite3_vtab_collation(sqlite3_index_info*,int); |
| 9571 | 9775 | ||
| 9572 | /* | 9776 | /* |
| 9573 | ** CAPI3REF: Determine if a virtual table query is DISTINCT | 9777 | ** CAPI3REF: Determine if a virtual table query is DISTINCT |
| @@ -9655,7 +9859,7 @@ SQLITE_API int sqlite3_vtab_distinct(sqlite3_index_info*); | |||
| 9655 | ** communicated to the xBestIndex method as a | 9859 | ** communicated to the xBestIndex method as a |
| 9656 | ** [SQLITE_INDEX_CONSTRAINT_EQ] constraint.)^ If xBestIndex wants to use | 9860 | ** [SQLITE_INDEX_CONSTRAINT_EQ] constraint.)^ If xBestIndex wants to use |
| 9657 | ** this constraint, it must set the corresponding | 9861 | ** this constraint, it must set the corresponding |
| 9658 | ** aConstraintUsage[].argvIndex to a postive integer. ^(Then, under | 9862 | ** aConstraintUsage[].argvIndex to a positive integer. ^(Then, under |
| 9659 | ** the usual mode of handling IN operators, SQLite generates [bytecode] | 9863 | ** the usual mode of handling IN operators, SQLite generates [bytecode] |
| 9660 | ** that invokes the [xFilter|xFilter() method] once for each value | 9864 | ** that invokes the [xFilter|xFilter() method] once for each value |
| 9661 | ** on the right-hand side of the IN operator.)^ Thus the virtual table | 9865 | ** on the right-hand side of the IN operator.)^ Thus the virtual table |
| @@ -9724,21 +9928,20 @@ SQLITE_API int sqlite3_vtab_in(sqlite3_index_info*, int iCons, int bHandle); | |||
| 9724 | ** is undefined and probably harmful. | 9928 | ** is undefined and probably harmful. |
| 9725 | ** | 9929 | ** |
| 9726 | ** The X parameter in a call to sqlite3_vtab_in_first(X,P) or | 9930 | ** The X parameter in a call to sqlite3_vtab_in_first(X,P) or |
| 9727 | ** sqlite3_vtab_in_next(X,P) must be one of the parameters to the | 9931 | ** sqlite3_vtab_in_next(X,P) should be one of the parameters to the |
| 9728 | ** xFilter method which invokes these routines, and specifically | 9932 | ** xFilter method which invokes these routines, and specifically |
| 9729 | ** a parameter that was previously selected for all-at-once IN constraint | 9933 | ** a parameter that was previously selected for all-at-once IN constraint |
| 9730 | ** processing use the [sqlite3_vtab_in()] interface in the | 9934 | ** processing use the [sqlite3_vtab_in()] interface in the |
| 9731 | ** [xBestIndex|xBestIndex method]. ^(If the X parameter is not | 9935 | ** [xBestIndex|xBestIndex method]. ^(If the X parameter is not |
| 9732 | ** an xFilter argument that was selected for all-at-once IN constraint | 9936 | ** an xFilter argument that was selected for all-at-once IN constraint |
| 9733 | ** processing, then these routines return [SQLITE_MISUSE])^ or perhaps | 9937 | ** processing, then these routines return [SQLITE_ERROR].)^ |
| 9734 | ** exhibit some other undefined or harmful behavior. | ||
| 9735 | ** | 9938 | ** |
| 9736 | ** ^(Use these routines to access all values on the right-hand side | 9939 | ** ^(Use these routines to access all values on the right-hand side |
| 9737 | ** of the IN constraint using code like the following: | 9940 | ** of the IN constraint using code like the following: |
| 9738 | ** | 9941 | ** |
| 9739 | ** <blockquote><pre> | 9942 | ** <blockquote><pre> |
| 9740 | ** for(rc=sqlite3_vtab_in_first(pList, &pVal); | 9943 | ** for(rc=sqlite3_vtab_in_first(pList, &pVal); |
| 9741 | ** rc==SQLITE_OK && pVal | 9944 | ** rc==SQLITE_OK && pVal; |
| 9742 | ** rc=sqlite3_vtab_in_next(pList, &pVal) | 9945 | ** rc=sqlite3_vtab_in_next(pList, &pVal) |
| 9743 | ** ){ | 9946 | ** ){ |
| 9744 | ** // do something with pVal | 9947 | ** // do something with pVal |
| @@ -9836,6 +10039,10 @@ SQLITE_API int sqlite3_vtab_rhs_value(sqlite3_index_info*, int, sqlite3_value ** | |||
| 9836 | ** managed by the prepared statement S and will be automatically freed when | 10039 | ** managed by the prepared statement S and will be automatically freed when |
| 9837 | ** S is finalized. | 10040 | ** S is finalized. |
| 9838 | ** | 10041 | ** |
| 10042 | ** Not all values are available for all query elements. When a value is | ||
| 10043 | ** not available, the output variable is set to -1 if the value is numeric, | ||
| 10044 | ** or to NULL if it is a string (SQLITE_SCANSTAT_NAME). | ||
| 10045 | ** | ||
| 9839 | ** <dl> | 10046 | ** <dl> |
| 9840 | ** [[SQLITE_SCANSTAT_NLOOP]] <dt>SQLITE_SCANSTAT_NLOOP</dt> | 10047 | ** [[SQLITE_SCANSTAT_NLOOP]] <dt>SQLITE_SCANSTAT_NLOOP</dt> |
| 9841 | ** <dd>^The [sqlite3_int64] variable pointed to by the V parameter will be | 10048 | ** <dd>^The [sqlite3_int64] variable pointed to by the V parameter will be |
| @@ -9863,12 +10070,24 @@ SQLITE_API int sqlite3_vtab_rhs_value(sqlite3_index_info*, int, sqlite3_value ** | |||
| 9863 | ** to a zero-terminated UTF-8 string containing the [EXPLAIN QUERY PLAN] | 10070 | ** to a zero-terminated UTF-8 string containing the [EXPLAIN QUERY PLAN] |
| 9864 | ** description for the X-th loop. | 10071 | ** description for the X-th loop. |
| 9865 | ** | 10072 | ** |
| 9866 | ** [[SQLITE_SCANSTAT_SELECTID]] <dt>SQLITE_SCANSTAT_SELECT</dt> | 10073 | ** [[SQLITE_SCANSTAT_SELECTID]] <dt>SQLITE_SCANSTAT_SELECTID</dt> |
| 9867 | ** <dd>^The "int" variable pointed to by the V parameter will be set to the | 10074 | ** <dd>^The "int" variable pointed to by the V parameter will be set to the |
| 9868 | ** "select-id" for the X-th loop. The select-id identifies which query or | 10075 | ** id for the X-th query plan element. The id value is unique within the |
| 9869 | ** subquery the loop is part of. The main query has a select-id of zero. | 10076 | ** statement. The select-id is the same value as is output in the first |
| 9870 | ** The select-id is the same value as is output in the first column | 10077 | ** column of an [EXPLAIN QUERY PLAN] query. |
| 9871 | ** of an [EXPLAIN QUERY PLAN] query. | 10078 | ** |
| 10079 | ** [[SQLITE_SCANSTAT_PARENTID]] <dt>SQLITE_SCANSTAT_PARENTID</dt> | ||
| 10080 | ** <dd>The "int" variable pointed to by the V parameter will be set to the | ||
| 10081 | ** the id of the parent of the current query element, if applicable, or | ||
| 10082 | ** to zero if the query element has no parent. This is the same value as | ||
| 10083 | ** returned in the second column of an [EXPLAIN QUERY PLAN] query. | ||
| 10084 | ** | ||
| 10085 | ** [[SQLITE_SCANSTAT_NCYCLE]] <dt>SQLITE_SCANSTAT_NCYCLE</dt> | ||
| 10086 | ** <dd>The sqlite3_int64 output value is set to the number of cycles, | ||
| 10087 | ** according to the processor time-stamp counter, that elapsed while the | ||
| 10088 | ** query element was being processed. This value is not available for | ||
| 10089 | ** all query elements - if it is unavailable the output variable is | ||
| 10090 | ** set to -1. | ||
| 9872 | ** </dl> | 10091 | ** </dl> |
| 9873 | */ | 10092 | */ |
| 9874 | #define SQLITE_SCANSTAT_NLOOP 0 | 10093 | #define SQLITE_SCANSTAT_NLOOP 0 |
| @@ -9877,12 +10096,14 @@ SQLITE_API int sqlite3_vtab_rhs_value(sqlite3_index_info*, int, sqlite3_value ** | |||
| 9877 | #define SQLITE_SCANSTAT_NAME 3 | 10096 | #define SQLITE_SCANSTAT_NAME 3 |
| 9878 | #define SQLITE_SCANSTAT_EXPLAIN 4 | 10097 | #define SQLITE_SCANSTAT_EXPLAIN 4 |
| 9879 | #define SQLITE_SCANSTAT_SELECTID 5 | 10098 | #define SQLITE_SCANSTAT_SELECTID 5 |
| 10099 | #define SQLITE_SCANSTAT_PARENTID 6 | ||
| 10100 | #define SQLITE_SCANSTAT_NCYCLE 7 | ||
| 9880 | 10101 | ||
| 9881 | /* | 10102 | /* |
| 9882 | ** CAPI3REF: Prepared Statement Scan Status | 10103 | ** CAPI3REF: Prepared Statement Scan Status |
| 9883 | ** METHOD: sqlite3_stmt | 10104 | ** METHOD: sqlite3_stmt |
| 9884 | ** | 10105 | ** |
| 9885 | ** This interface returns information about the predicted and measured | 10106 | ** These interfaces return information about the predicted and measured |
| 9886 | ** performance for pStmt. Advanced applications can use this | 10107 | ** performance for pStmt. Advanced applications can use this |
| 9887 | ** interface to compare the predicted and the measured performance and | 10108 | ** interface to compare the predicted and the measured performance and |
| 9888 | ** issue warnings and/or rerun [ANALYZE] if discrepancies are found. | 10109 | ** issue warnings and/or rerun [ANALYZE] if discrepancies are found. |
| @@ -9893,19 +10114,25 @@ SQLITE_API int sqlite3_vtab_rhs_value(sqlite3_index_info*, int, sqlite3_value ** | |||
| 9893 | ** | 10114 | ** |
| 9894 | ** The "iScanStatusOp" parameter determines which status information to return. | 10115 | ** The "iScanStatusOp" parameter determines which status information to return. |
| 9895 | ** The "iScanStatusOp" must be one of the [scanstatus options] or the behavior | 10116 | ** The "iScanStatusOp" must be one of the [scanstatus options] or the behavior |
| 9896 | ** of this interface is undefined. | 10117 | ** of this interface is undefined. ^The requested measurement is written into |
| 9897 | ** ^The requested measurement is written into a variable pointed to by | 10118 | ** a variable pointed to by the "pOut" parameter. |
| 9898 | ** the "pOut" parameter. | 10119 | ** |
| 9899 | ** Parameter "idx" identifies the specific loop to retrieve statistics for. | 10120 | ** The "flags" parameter must be passed a mask of flags. At present only |
| 9900 | ** Loops are numbered starting from zero. ^If idx is out of range - less than | 10121 | ** one flag is defined - SQLITE_SCANSTAT_COMPLEX. If SQLITE_SCANSTAT_COMPLEX |
| 9901 | ** zero or greater than or equal to the total number of loops used to implement | 10122 | ** is specified, then status information is available for all elements |
| 9902 | ** the statement - a non-zero value is returned and the variable that pOut | 10123 | ** of a query plan that are reported by "EXPLAIN QUERY PLAN" output. If |
| 9903 | ** points to is unchanged. | 10124 | ** SQLITE_SCANSTAT_COMPLEX is not specified, then only query plan elements |
| 9904 | ** | 10125 | ** that correspond to query loops (the "SCAN..." and "SEARCH..." elements of |
| 9905 | ** ^Statistics might not be available for all loops in all statements. ^In cases | 10126 | ** the EXPLAIN QUERY PLAN output) are available. Invoking API |
| 9906 | ** where there exist loops with no available statistics, this function behaves | 10127 | ** sqlite3_stmt_scanstatus() is equivalent to calling |
| 9907 | ** as if the loop did not exist - it returns non-zero and leave the variable | 10128 | ** sqlite3_stmt_scanstatus_v2() with a zeroed flags parameter. |
| 9908 | ** that pOut points to unchanged. | 10129 | ** |
| 10130 | ** Parameter "idx" identifies the specific query element to retrieve statistics | ||
| 10131 | ** for. Query elements are numbered starting from zero. A value of -1 may be | ||
| 10132 | ** to query for statistics regarding the entire query. ^If idx is out of range | ||
| 10133 | ** - less than -1 or greater than or equal to the total number of query | ||
| 10134 | ** elements used to implement the statement - a non-zero value is returned and | ||
| 10135 | ** the variable that pOut points to is unchanged. | ||
| 9909 | ** | 10136 | ** |
| 9910 | ** See also: [sqlite3_stmt_scanstatus_reset()] | 10137 | ** See also: [sqlite3_stmt_scanstatus_reset()] |
| 9911 | */ | 10138 | */ |
| @@ -9915,6 +10142,19 @@ SQLITE_API int sqlite3_stmt_scanstatus( | |||
| 9915 | int iScanStatusOp, /* Information desired. SQLITE_SCANSTAT_* */ | 10142 | int iScanStatusOp, /* Information desired. SQLITE_SCANSTAT_* */ |
| 9916 | void *pOut /* Result written here */ | 10143 | void *pOut /* Result written here */ |
| 9917 | ); | 10144 | ); |
| 10145 | SQLITE_API int sqlite3_stmt_scanstatus_v2( | ||
| 10146 | sqlite3_stmt *pStmt, /* Prepared statement for which info desired */ | ||
| 10147 | int idx, /* Index of loop to report on */ | ||
| 10148 | int iScanStatusOp, /* Information desired. SQLITE_SCANSTAT_* */ | ||
| 10149 | int flags, /* Mask of flags defined below */ | ||
| 10150 | void *pOut /* Result written here */ | ||
| 10151 | ); | ||
| 10152 | |||
| 10153 | /* | ||
| 10154 | ** CAPI3REF: Prepared Statement Scan Status | ||
| 10155 | ** KEYWORDS: {scan status flags} | ||
| 10156 | */ | ||
| 10157 | #define SQLITE_SCANSTAT_COMPLEX 0x0001 | ||
| 9918 | 10158 | ||
| 9919 | /* | 10159 | /* |
| 9920 | ** CAPI3REF: Zero Scan-Status Counters | 10160 | ** CAPI3REF: Zero Scan-Status Counters |
| @@ -10005,6 +10245,10 @@ SQLITE_API int sqlite3_db_cacheflush(sqlite3*); | |||
| 10005 | ** function is not defined for operations on WITHOUT ROWID tables, or for | 10245 | ** function is not defined for operations on WITHOUT ROWID tables, or for |
| 10006 | ** DELETE operations on rowid tables. | 10246 | ** DELETE operations on rowid tables. |
| 10007 | ** | 10247 | ** |
| 10248 | ** ^The sqlite3_preupdate_hook(D,C,P) function returns the P argument from | ||
| 10249 | ** the previous call on the same [database connection] D, or NULL for | ||
| 10250 | ** the first call on D. | ||
| 10251 | ** | ||
| 10008 | ** The [sqlite3_preupdate_old()], [sqlite3_preupdate_new()], | 10252 | ** The [sqlite3_preupdate_old()], [sqlite3_preupdate_new()], |
| 10009 | ** [sqlite3_preupdate_count()], and [sqlite3_preupdate_depth()] interfaces | 10253 | ** [sqlite3_preupdate_count()], and [sqlite3_preupdate_depth()] interfaces |
| 10010 | ** provide additional information about a preupdate event. These routines | 10254 | ** provide additional information about a preupdate event. These routines |
| @@ -10044,7 +10288,7 @@ SQLITE_API int sqlite3_db_cacheflush(sqlite3*); | |||
| 10044 | ** When the [sqlite3_blob_write()] API is used to update a blob column, | 10288 | ** When the [sqlite3_blob_write()] API is used to update a blob column, |
| 10045 | ** the pre-update hook is invoked with SQLITE_DELETE. This is because the | 10289 | ** the pre-update hook is invoked with SQLITE_DELETE. This is because the |
| 10046 | ** in this case the new values are not available. In this case, when a | 10290 | ** in this case the new values are not available. In this case, when a |
| 10047 | ** callback made with op==SQLITE_DELETE is actuall a write using the | 10291 | ** callback made with op==SQLITE_DELETE is actually a write using the |
| 10048 | ** sqlite3_blob_write() API, the [sqlite3_preupdate_blobwrite()] returns | 10292 | ** sqlite3_blob_write() API, the [sqlite3_preupdate_blobwrite()] returns |
| 10049 | ** the index of the column being written. In other cases, where the | 10293 | ** the index of the column being written. In other cases, where the |
| 10050 | ** pre-update hook is being invoked for some other reason, including a | 10294 | ** pre-update hook is being invoked for some other reason, including a |
| @@ -10410,6 +10654,19 @@ SQLITE_API int sqlite3_deserialize( | |||
| 10410 | # undef double | 10654 | # undef double |
| 10411 | #endif | 10655 | #endif |
| 10412 | 10656 | ||
| 10657 | #if defined(__wasi__) | ||
| 10658 | # undef SQLITE_WASI | ||
| 10659 | # define SQLITE_WASI 1 | ||
| 10660 | # undef SQLITE_OMIT_WAL | ||
| 10661 | # define SQLITE_OMIT_WAL 1/* because it requires shared memory APIs */ | ||
| 10662 | # ifndef SQLITE_OMIT_LOAD_EXTENSION | ||
| 10663 | # define SQLITE_OMIT_LOAD_EXTENSION | ||
| 10664 | # endif | ||
| 10665 | # ifndef SQLITE_THREADSAFE | ||
| 10666 | # define SQLITE_THREADSAFE 0 | ||
| 10667 | # endif | ||
| 10668 | #endif | ||
| 10669 | |||
| 10413 | #ifdef __cplusplus | 10670 | #ifdef __cplusplus |
| 10414 | } /* End of the 'extern "C"' block */ | 10671 | } /* End of the 'extern "C"' block */ |
| 10415 | #endif | 10672 | #endif |
| @@ -10616,16 +10873,20 @@ SQLITE_API int sqlite3session_create( | |||
| 10616 | SQLITE_API void sqlite3session_delete(sqlite3_session *pSession); | 10873 | SQLITE_API void sqlite3session_delete(sqlite3_session *pSession); |
| 10617 | 10874 | ||
| 10618 | /* | 10875 | /* |
| 10619 | ** CAPIREF: Conigure a Session Object | 10876 | ** CAPI3REF: Configure a Session Object |
| 10620 | ** METHOD: sqlite3_session | 10877 | ** METHOD: sqlite3_session |
| 10621 | ** | 10878 | ** |
| 10622 | ** This method is used to configure a session object after it has been | 10879 | ** This method is used to configure a session object after it has been |
| 10623 | ** created. At present the only valid value for the second parameter is | 10880 | ** created. At present the only valid values for the second parameter are |
| 10624 | ** [SQLITE_SESSION_OBJCONFIG_SIZE]. | 10881 | ** [SQLITE_SESSION_OBJCONFIG_SIZE] and [SQLITE_SESSION_OBJCONFIG_ROWID]. |
| 10625 | ** | 10882 | ** |
| 10626 | ** Arguments for sqlite3session_object_config() | 10883 | */ |
| 10884 | SQLITE_API int sqlite3session_object_config(sqlite3_session*, int op, void *pArg); | ||
| 10885 | |||
| 10886 | /* | ||
| 10887 | ** CAPI3REF: Options for sqlite3session_object_config | ||
| 10627 | ** | 10888 | ** |
| 10628 | ** The following values may passed as the the 4th parameter to | 10889 | ** The following values may passed as the the 2nd parameter to |
| 10629 | ** sqlite3session_object_config(). | 10890 | ** sqlite3session_object_config(). |
| 10630 | ** | 10891 | ** |
| 10631 | ** <dt>SQLITE_SESSION_OBJCONFIG_SIZE <dd> | 10892 | ** <dt>SQLITE_SESSION_OBJCONFIG_SIZE <dd> |
| @@ -10641,12 +10902,21 @@ SQLITE_API void sqlite3session_delete(sqlite3_session *pSession); | |||
| 10641 | ** | 10902 | ** |
| 10642 | ** It is an error (SQLITE_MISUSE) to attempt to modify this setting after | 10903 | ** It is an error (SQLITE_MISUSE) to attempt to modify this setting after |
| 10643 | ** the first table has been attached to the session object. | 10904 | ** the first table has been attached to the session object. |
| 10905 | ** | ||
| 10906 | ** <dt>SQLITE_SESSION_OBJCONFIG_ROWID <dd> | ||
| 10907 | ** This option is used to set, clear or query the flag that enables | ||
| 10908 | ** collection of data for tables with no explicit PRIMARY KEY. | ||
| 10909 | ** | ||
| 10910 | ** Normally, tables with no explicit PRIMARY KEY are simply ignored | ||
| 10911 | ** by the sessions module. However, if this flag is set, it behaves | ||
| 10912 | ** as if such tables have a column "_rowid_ INTEGER PRIMARY KEY" inserted | ||
| 10913 | ** as their leftmost columns. | ||
| 10914 | ** | ||
| 10915 | ** It is an error (SQLITE_MISUSE) to attempt to modify this setting after | ||
| 10916 | ** the first table has been attached to the session object. | ||
| 10644 | */ | 10917 | */ |
| 10645 | SQLITE_API int sqlite3session_object_config(sqlite3_session*, int op, void *pArg); | 10918 | #define SQLITE_SESSION_OBJCONFIG_SIZE 1 |
| 10646 | 10919 | #define SQLITE_SESSION_OBJCONFIG_ROWID 2 | |
| 10647 | /* | ||
| 10648 | */ | ||
| 10649 | #define SQLITE_SESSION_OBJCONFIG_SIZE 1 | ||
| 10650 | 10920 | ||
| 10651 | /* | 10921 | /* |
| 10652 | ** CAPI3REF: Enable Or Disable A Session Object | 10922 | ** CAPI3REF: Enable Or Disable A Session Object |
| @@ -11779,9 +12049,23 @@ SQLITE_API int sqlite3changeset_apply_v2( | |||
| 11779 | ** Invert the changeset before applying it. This is equivalent to inverting | 12049 | ** Invert the changeset before applying it. This is equivalent to inverting |
| 11780 | ** a changeset using sqlite3changeset_invert() before applying it. It is | 12050 | ** a changeset using sqlite3changeset_invert() before applying it. It is |
| 11781 | ** an error to specify this flag with a patchset. | 12051 | ** an error to specify this flag with a patchset. |
| 12052 | ** | ||
| 12053 | ** <dt>SQLITE_CHANGESETAPPLY_IGNORENOOP <dd> | ||
| 12054 | ** Do not invoke the conflict handler callback for any changes that | ||
| 12055 | ** would not actually modify the database even if they were applied. | ||
| 12056 | ** Specifically, this means that the conflict handler is not invoked | ||
| 12057 | ** for: | ||
| 12058 | ** <ul> | ||
| 12059 | ** <li>a delete change if the row being deleted cannot be found, | ||
| 12060 | ** <li>an update change if the modified fields are already set to | ||
| 12061 | ** their new values in the conflicting row, or | ||
| 12062 | ** <li>an insert change if all fields of the conflicting row match | ||
| 12063 | ** the row being inserted. | ||
| 12064 | ** </ul> | ||
| 11782 | */ | 12065 | */ |
| 11783 | #define SQLITE_CHANGESETAPPLY_NOSAVEPOINT 0x0001 | 12066 | #define SQLITE_CHANGESETAPPLY_NOSAVEPOINT 0x0001 |
| 11784 | #define SQLITE_CHANGESETAPPLY_INVERT 0x0002 | 12067 | #define SQLITE_CHANGESETAPPLY_INVERT 0x0002 |
| 12068 | #define SQLITE_CHANGESETAPPLY_IGNORENOOP 0x0004 | ||
| 11785 | 12069 | ||
| 11786 | /* | 12070 | /* |
| 11787 | ** CAPI3REF: Constants Passed To The Conflict Handler | 12071 | ** CAPI3REF: Constants Passed To The Conflict Handler |
| @@ -12522,7 +12806,7 @@ struct Fts5PhraseIter { | |||
| 12522 | ** See xPhraseFirstColumn above. | 12806 | ** See xPhraseFirstColumn above. |
| 12523 | */ | 12807 | */ |
| 12524 | struct Fts5ExtensionApi { | 12808 | struct Fts5ExtensionApi { |
| 12525 | int iVersion; /* Currently always set to 3 */ | 12809 | int iVersion; /* Currently always set to 2 */ |
| 12526 | 12810 | ||
| 12527 | void *(*xUserData)(Fts5Context*); | 12811 | void *(*xUserData)(Fts5Context*); |
| 12528 | 12812 | ||
| @@ -12751,8 +13035,8 @@ struct Fts5ExtensionApi { | |||
| 12751 | ** as separate queries of the FTS index are required for each synonym. | 13035 | ** as separate queries of the FTS index are required for each synonym. |
| 12752 | ** | 13036 | ** |
| 12753 | ** When using methods (2) or (3), it is important that the tokenizer only | 13037 | ** When using methods (2) or (3), it is important that the tokenizer only |
| 12754 | ** provide synonyms when tokenizing document text (method (2)) or query | 13038 | ** provide synonyms when tokenizing document text (method (3)) or query |
| 12755 | ** text (method (3)), not both. Doing so will not cause any errors, but is | 13039 | ** text (method (2)), not both. Doing so will not cause any errors, but is |
| 12756 | ** inefficient. | 13040 | ** inefficient. |
| 12757 | */ | 13041 | */ |
| 12758 | typedef struct Fts5Tokenizer Fts5Tokenizer; | 13042 | typedef struct Fts5Tokenizer Fts5Tokenizer; |
| @@ -12800,7 +13084,7 @@ struct fts5_api { | |||
| 12800 | int (*xCreateTokenizer)( | 13084 | int (*xCreateTokenizer)( |
| 12801 | fts5_api *pApi, | 13085 | fts5_api *pApi, |
| 12802 | const char *zName, | 13086 | const char *zName, |
| 12803 | void *pContext, | 13087 | void *pUserData, |
| 12804 | fts5_tokenizer *pTokenizer, | 13088 | fts5_tokenizer *pTokenizer, |
| 12805 | void (*xDestroy)(void*) | 13089 | void (*xDestroy)(void*) |
| 12806 | ); | 13090 | ); |
| @@ -12809,7 +13093,7 @@ struct fts5_api { | |||
| 12809 | int (*xFindTokenizer)( | 13093 | int (*xFindTokenizer)( |
| 12810 | fts5_api *pApi, | 13094 | fts5_api *pApi, |
| 12811 | const char *zName, | 13095 | const char *zName, |
| 12812 | void **ppContext, | 13096 | void **ppUserData, |
| 12813 | fts5_tokenizer *pTokenizer | 13097 | fts5_tokenizer *pTokenizer |
| 12814 | ); | 13098 | ); |
| 12815 | 13099 | ||
| @@ -12817,7 +13101,7 @@ struct fts5_api { | |||
| 12817 | int (*xCreateFunction)( | 13101 | int (*xCreateFunction)( |
| 12818 | fts5_api *pApi, | 13102 | fts5_api *pApi, |
| 12819 | const char *zName, | 13103 | const char *zName, |
| 12820 | void *pContext, | 13104 | void *pUserData, |
| 12821 | fts5_extension_function xFunction, | 13105 | fts5_extension_function xFunction, |
| 12822 | void (*xDestroy)(void*) | 13106 | void (*xDestroy)(void*) |
| 12823 | ); | 13107 | ); |