diff options
Diffstat (limited to '')
| -rw-r--r-- | c/sqlite3.h | 133 |
1 files changed, 111 insertions, 22 deletions
diff --git a/c/sqlite3.h b/c/sqlite3.h index 19ee767..3274bbe 100644 --- a/c/sqlite3.h +++ b/c/sqlite3.h | |||
| @@ -123,9 +123,9 @@ extern "C" { | |||
| 123 | ** [sqlite3_libversion_number()], [sqlite3_sourceid()], | 123 | ** [sqlite3_libversion_number()], [sqlite3_sourceid()], |
| 124 | ** [sqlite_version()] and [sqlite_source_id()]. | 124 | ** [sqlite_version()] and [sqlite_source_id()]. |
| 125 | */ | 125 | */ |
| 126 | #define SQLITE_VERSION "3.35.5" | 126 | #define SQLITE_VERSION "3.36.0" |
| 127 | #define SQLITE_VERSION_NUMBER 3035005 | 127 | #define SQLITE_VERSION_NUMBER 3036000 |
| 128 | #define SQLITE_SOURCE_ID "2021-04-19 18:32:05 1b256d97b553a9611efca188a3d995a2fff712759044ba480f9a0c9e98fae886" | 128 | #define SQLITE_SOURCE_ID "2021-06-18 18:36:39 5c9a6c06871cb9fe42814af9c039eb6da5427a6ec28f187af7ebfb62eafa66e5" |
| 129 | 129 | ||
| 130 | /* | 130 | /* |
| 131 | ** CAPI3REF: Run-Time Library Version Numbers | 131 | ** CAPI3REF: Run-Time Library Version Numbers |
| @@ -1128,6 +1128,23 @@ struct sqlite3_io_methods { | |||
| 1128 | ** file to the database file, but before the *-shm file is updated to | 1128 | ** file to the database file, but before the *-shm file is updated to |
| 1129 | ** record the fact that the pages have been checkpointed. | 1129 | ** record the fact that the pages have been checkpointed. |
| 1130 | ** </ul> | 1130 | ** </ul> |
| 1131 | ** | ||
| 1132 | ** <li>[[SQLITE_FCNTL_EXTERNAL_READER]] | ||
| 1133 | ** The EXPERIMENTAL [SQLITE_FCNTL_EXTERNAL_READER] opcode is used to detect | ||
| 1134 | ** whether or not there is a database client in another process with a wal-mode | ||
| 1135 | ** transaction open on the database or not. It is only available on unix.The | ||
| 1136 | ** (void*) argument passed with this file-control should be a pointer to a | ||
| 1137 | ** value of type (int). The integer value is set to 1 if the database is a wal | ||
| 1138 | ** mode database and there exists at least one client in another process that | ||
| 1139 | ** currently has an SQL transaction open on the database. It is set to 0 if | ||
| 1140 | ** the database is not a wal-mode db, or if there is no such connection in any | ||
| 1141 | ** other process. This opcode cannot be used to detect transactions opened | ||
| 1142 | ** by clients within the current process, only within other processes. | ||
| 1143 | ** </ul> | ||
| 1144 | ** | ||
| 1145 | ** <li>[[SQLITE_FCNTL_CKSM_FILE]] | ||
| 1146 | ** Used by the cksmvfs VFS module only. | ||
| 1147 | ** </ul> | ||
| 1131 | */ | 1148 | */ |
| 1132 | #define SQLITE_FCNTL_LOCKSTATE 1 | 1149 | #define SQLITE_FCNTL_LOCKSTATE 1 |
| 1133 | #define SQLITE_FCNTL_GET_LOCKPROXYFILE 2 | 1150 | #define SQLITE_FCNTL_GET_LOCKPROXYFILE 2 |
| @@ -1167,6 +1184,8 @@ struct sqlite3_io_methods { | |||
| 1167 | #define SQLITE_FCNTL_CKPT_DONE 37 | 1184 | #define SQLITE_FCNTL_CKPT_DONE 37 |
| 1168 | #define SQLITE_FCNTL_RESERVE_BYTES 38 | 1185 | #define SQLITE_FCNTL_RESERVE_BYTES 38 |
| 1169 | #define SQLITE_FCNTL_CKPT_START 39 | 1186 | #define SQLITE_FCNTL_CKPT_START 39 |
| 1187 | #define SQLITE_FCNTL_EXTERNAL_READER 40 | ||
| 1188 | #define SQLITE_FCNTL_CKSM_FILE 41 | ||
| 1170 | 1189 | ||
| 1171 | /* deprecated names */ | 1190 | /* deprecated names */ |
| 1172 | #define SQLITE_GET_LOCKPROXYFILE SQLITE_FCNTL_GET_LOCKPROXYFILE | 1191 | #define SQLITE_GET_LOCKPROXYFILE SQLITE_FCNTL_GET_LOCKPROXYFILE |
| @@ -4179,6 +4198,15 @@ SQLITE_API const char *sqlite3_normalized_sql(sqlite3_stmt *pStmt); | |||
| 4179 | ** [BEGIN] merely sets internal flags, but the [BEGIN|BEGIN IMMEDIATE] and | 4198 | ** [BEGIN] merely sets internal flags, but the [BEGIN|BEGIN IMMEDIATE] and |
| 4180 | ** [BEGIN|BEGIN EXCLUSIVE] commands do touch the database and so | 4199 | ** [BEGIN|BEGIN EXCLUSIVE] commands do touch the database and so |
| 4181 | ** sqlite3_stmt_readonly() returns false for those commands. | 4200 | ** sqlite3_stmt_readonly() returns false for those commands. |
| 4201 | ** | ||
| 4202 | ** ^This routine returns false if there is any possibility that the | ||
| 4203 | ** statement might change the database file. ^A false return does | ||
| 4204 | ** not guarantee that the statement will change the database file. | ||
| 4205 | ** ^For example, an UPDATE statement might have a WHERE clause that | ||
| 4206 | ** makes it a no-op, but the sqlite3_stmt_readonly() result would still | ||
| 4207 | ** be false. ^Similarly, a CREATE TABLE IF NOT EXISTS statement is a | ||
| 4208 | ** read-only no-op if the table already exists, but | ||
| 4209 | ** sqlite3_stmt_readonly() still returns false for such a statement. | ||
| 4182 | */ | 4210 | */ |
| 4183 | SQLITE_API int sqlite3_stmt_readonly(sqlite3_stmt *pStmt); | 4211 | SQLITE_API int sqlite3_stmt_readonly(sqlite3_stmt *pStmt); |
| 4184 | 4212 | ||
| @@ -4348,18 +4376,22 @@ typedef struct sqlite3_context sqlite3_context; | |||
| 4348 | ** contain embedded NULs. The result of expressions involving strings | 4376 | ** contain embedded NULs. The result of expressions involving strings |
| 4349 | ** with embedded NULs is undefined. | 4377 | ** with embedded NULs is undefined. |
| 4350 | ** | 4378 | ** |
| 4351 | ** ^The fifth argument to the BLOB and string binding interfaces | 4379 | ** ^The fifth argument to the BLOB and string binding interfaces controls |
| 4352 | ** is a destructor used to dispose of the BLOB or | 4380 | ** or indicates the lifetime of the object referenced by the third parameter. |
| 4353 | ** string after SQLite has finished with it. ^The destructor is called | 4381 | ** These three options exist: |
| 4354 | ** to dispose of the BLOB or string even if the call to the bind API fails, | 4382 | ** ^ (1) A destructor to dispose of the BLOB or string after SQLite has finished |
| 4355 | ** except the destructor is not called if the third parameter is a NULL | 4383 | ** with it may be passed. ^It is called to dispose of the BLOB or string even |
| 4356 | ** pointer or the fourth parameter is negative. | 4384 | ** if the call to the bind API fails, except the destructor is not called if |
| 4357 | ** ^If the fifth argument is | 4385 | ** the third parameter is a NULL pointer or the fourth parameter is negative. |
| 4358 | ** the special value [SQLITE_STATIC], then SQLite assumes that the | 4386 | ** ^ (2) The special constant, [SQLITE_STATIC], may be passsed to indicate that |
| 4359 | ** information is in static, unmanaged space and does not need to be freed. | 4387 | ** the application remains responsible for disposing of the object. ^In this |
| 4360 | ** ^If the fifth argument has the value [SQLITE_TRANSIENT], then | 4388 | ** case, the object and the provided pointer to it must remain valid until |
| 4361 | ** SQLite makes its own private copy of the data immediately, before | 4389 | ** either the prepared statement is finalized or the same SQL parameter is |
| 4362 | ** the sqlite3_bind_*() routine returns. | 4390 | ** bound to something else, whichever occurs sooner. |
| 4391 | ** ^ (3) The constant, [SQLITE_TRANSIENT], may be passed to indicate that the | ||
| 4392 | ** object is to be copied prior to the return from sqlite3_bind_*(). ^The | ||
| 4393 | ** object and pointer to it must remain valid until then. ^SQLite will then | ||
| 4394 | ** manage the lifetime of its private copy. | ||
| 4363 | ** | 4395 | ** |
| 4364 | ** ^The sixth argument to sqlite3_bind_text64() must be one of | 4396 | ** ^The sixth argument to sqlite3_bind_text64() must be one of |
| 4365 | ** [SQLITE_UTF8], [SQLITE_UTF16], [SQLITE_UTF16BE], or [SQLITE_UTF16LE] | 4397 | ** [SQLITE_UTF8], [SQLITE_UTF16], [SQLITE_UTF16BE], or [SQLITE_UTF16LE] |
| @@ -5101,7 +5133,6 @@ SQLITE_API int sqlite3_reset(sqlite3_stmt *pStmt); | |||
| 5101 | ** within VIEWs, TRIGGERs, CHECK constraints, generated column expressions, | 5133 | ** within VIEWs, TRIGGERs, CHECK constraints, generated column expressions, |
| 5102 | ** index expressions, or the WHERE clause of partial indexes. | 5134 | ** index expressions, or the WHERE clause of partial indexes. |
| 5103 | ** | 5135 | ** |
| 5104 | ** <span style="background-color:#ffff90;"> | ||
| 5105 | ** For best security, the [SQLITE_DIRECTONLY] flag is recommended for | 5136 | ** For best security, the [SQLITE_DIRECTONLY] flag is recommended for |
| 5106 | ** all application-defined SQL functions that do not need to be | 5137 | ** all application-defined SQL functions that do not need to be |
| 5107 | ** used inside of triggers, view, CHECK constraints, or other elements of | 5138 | ** used inside of triggers, view, CHECK constraints, or other elements of |
| @@ -5111,7 +5142,6 @@ SQLITE_API int sqlite3_reset(sqlite3_stmt *pStmt); | |||
| 5111 | ** a database file to include invocations of the function with parameters | 5142 | ** a database file to include invocations of the function with parameters |
| 5112 | ** chosen by the attacker, which the application will then execute when | 5143 | ** chosen by the attacker, which the application will then execute when |
| 5113 | ** the database file is opened and read. | 5144 | ** the database file is opened and read. |
| 5114 | ** </span> | ||
| 5115 | ** | 5145 | ** |
| 5116 | ** ^(The fifth parameter is an arbitrary pointer. The implementation of the | 5146 | ** ^(The fifth parameter is an arbitrary pointer. The implementation of the |
| 5117 | ** function can gain access to this pointer using [sqlite3_user_data()].)^ | 5147 | ** function can gain access to this pointer using [sqlite3_user_data()].)^ |
| @@ -7779,7 +7809,8 @@ SQLITE_API int sqlite3_test_control(int op, ...); | |||
| 7779 | #define SQLITE_TESTCTRL_EXTRA_SCHEMA_CHECKS 29 | 7809 | #define SQLITE_TESTCTRL_EXTRA_SCHEMA_CHECKS 29 |
| 7780 | #define SQLITE_TESTCTRL_SEEK_COUNT 30 | 7810 | #define SQLITE_TESTCTRL_SEEK_COUNT 30 |
| 7781 | #define SQLITE_TESTCTRL_TRACEFLAGS 31 | 7811 | #define SQLITE_TESTCTRL_TRACEFLAGS 31 |
| 7782 | #define SQLITE_TESTCTRL_LAST 31 /* Largest TESTCTRL */ | 7812 | #define SQLITE_TESTCTRL_TUNE 32 |
| 7813 | #define SQLITE_TESTCTRL_LAST 32 /* Largest TESTCTRL */ | ||
| 7783 | 7814 | ||
| 7784 | /* | 7815 | /* |
| 7785 | ** CAPI3REF: SQL Keyword Checking | 7816 | ** CAPI3REF: SQL Keyword Checking |
| @@ -9531,6 +9562,15 @@ SQLITE_API int sqlite3_db_cacheflush(sqlite3*); | |||
| 9531 | ** triggers; or 2 for changes resulting from triggers called by top-level | 9562 | ** triggers; or 2 for changes resulting from triggers called by top-level |
| 9532 | ** triggers; and so forth. | 9563 | ** triggers; and so forth. |
| 9533 | ** | 9564 | ** |
| 9565 | ** When the [sqlite3_blob_write()] API is used to update a blob column, | ||
| 9566 | ** the pre-update hook is invoked with SQLITE_DELETE. This is because the | ||
| 9567 | ** in this case the new values are not available. In this case, when a | ||
| 9568 | ** callback made with op==SQLITE_DELETE is actuall a write using the | ||
| 9569 | ** sqlite3_blob_write() API, the [sqlite3_preupdate_blobwrite()] returns | ||
| 9570 | ** the index of the column being written. In other cases, where the | ||
| 9571 | ** pre-update hook is being invoked for some other reason, including a | ||
| 9572 | ** regular DELETE, sqlite3_preupdate_blobwrite() returns -1. | ||
| 9573 | ** | ||
| 9534 | ** See also: [sqlite3_update_hook()] | 9574 | ** See also: [sqlite3_update_hook()] |
| 9535 | */ | 9575 | */ |
| 9536 | #if defined(SQLITE_ENABLE_PREUPDATE_HOOK) | 9576 | #if defined(SQLITE_ENABLE_PREUPDATE_HOOK) |
| @@ -9551,6 +9591,7 @@ SQLITE_API int sqlite3_preupdate_old(sqlite3 *, int, sqlite3_value **); | |||
| 9551 | SQLITE_API int sqlite3_preupdate_count(sqlite3 *); | 9591 | SQLITE_API int sqlite3_preupdate_count(sqlite3 *); |
| 9552 | SQLITE_API int sqlite3_preupdate_depth(sqlite3 *); | 9592 | SQLITE_API int sqlite3_preupdate_depth(sqlite3 *); |
| 9553 | SQLITE_API int sqlite3_preupdate_new(sqlite3 *, int, sqlite3_value **); | 9593 | SQLITE_API int sqlite3_preupdate_new(sqlite3 *, int, sqlite3_value **); |
| 9594 | SQLITE_API int sqlite3_preupdate_blobwrite(sqlite3 *); | ||
| 9554 | #endif | 9595 | #endif |
| 9555 | 9596 | ||
| 9556 | /* | 9597 | /* |
| @@ -9789,8 +9830,8 @@ SQLITE_API SQLITE_EXPERIMENTAL int sqlite3_snapshot_recover(sqlite3 *db, const c | |||
| 9789 | ** SQLITE_SERIALIZE_NOCOPY bit is omitted from argument F if a memory | 9830 | ** SQLITE_SERIALIZE_NOCOPY bit is omitted from argument F if a memory |
| 9790 | ** allocation error occurs. | 9831 | ** allocation error occurs. |
| 9791 | ** | 9832 | ** |
| 9792 | ** This interface is only available if SQLite is compiled with the | 9833 | ** This interface is omitted if SQLite is compiled with the |
| 9793 | ** [SQLITE_ENABLE_DESERIALIZE] option. | 9834 | ** [SQLITE_OMIT_DESERIALIZE] option. |
| 9794 | */ | 9835 | */ |
| 9795 | SQLITE_API unsigned char *sqlite3_serialize( | 9836 | SQLITE_API unsigned char *sqlite3_serialize( |
| 9796 | sqlite3 *db, /* The database connection */ | 9837 | sqlite3 *db, /* The database connection */ |
| @@ -9841,8 +9882,8 @@ SQLITE_API unsigned char *sqlite3_serialize( | |||
| 9841 | ** SQLITE_DESERIALIZE_FREEONCLOSE bit is set in argument F, then | 9882 | ** SQLITE_DESERIALIZE_FREEONCLOSE bit is set in argument F, then |
| 9842 | ** [sqlite3_free()] is invoked on argument P prior to returning. | 9883 | ** [sqlite3_free()] is invoked on argument P prior to returning. |
| 9843 | ** | 9884 | ** |
| 9844 | ** This interface is only available if SQLite is compiled with the | 9885 | ** This interface is omitted if SQLite is compiled with the |
| 9845 | ** [SQLITE_ENABLE_DESERIALIZE] option. | 9886 | ** [SQLITE_OMIT_DESERIALIZE] option. |
| 9846 | */ | 9887 | */ |
| 9847 | SQLITE_API int sqlite3_deserialize( | 9888 | SQLITE_API int sqlite3_deserialize( |
| 9848 | sqlite3 *db, /* The database connection */ | 9889 | sqlite3 *db, /* The database connection */ |
| @@ -10091,6 +10132,38 @@ SQLITE_API int sqlite3session_create( | |||
| 10091 | */ | 10132 | */ |
| 10092 | SQLITE_API void sqlite3session_delete(sqlite3_session *pSession); | 10133 | SQLITE_API void sqlite3session_delete(sqlite3_session *pSession); |
| 10093 | 10134 | ||
| 10135 | /* | ||
| 10136 | ** CAPIREF: Conigure a Session Object | ||
| 10137 | ** METHOD: sqlite3_session | ||
| 10138 | ** | ||
| 10139 | ** This method is used to configure a session object after it has been | ||
| 10140 | ** created. At present the only valid value for the second parameter is | ||
| 10141 | ** [SQLITE_SESSION_OBJCONFIG_SIZE]. | ||
| 10142 | ** | ||
| 10143 | ** Arguments for sqlite3session_object_config() | ||
| 10144 | ** | ||
| 10145 | ** The following values may passed as the the 4th parameter to | ||
| 10146 | ** sqlite3session_object_config(). | ||
| 10147 | ** | ||
| 10148 | ** <dt>SQLITE_SESSION_OBJCONFIG_SIZE <dd> | ||
| 10149 | ** This option is used to set, clear or query the flag that enables | ||
| 10150 | ** the [sqlite3session_changeset_size()] API. Because it imposes some | ||
| 10151 | ** computational overhead, this API is disabled by default. Argument | ||
| 10152 | ** pArg must point to a value of type (int). If the value is initially | ||
| 10153 | ** 0, then the sqlite3session_changeset_size() API is disabled. If it | ||
| 10154 | ** is greater than 0, then the same API is enabled. Or, if the initial | ||
| 10155 | ** value is less than zero, no change is made. In all cases the (int) | ||
| 10156 | ** variable is set to 1 if the sqlite3session_changeset_size() API is | ||
| 10157 | ** enabled following the current call, or 0 otherwise. | ||
| 10158 | ** | ||
| 10159 | ** It is an error (SQLITE_MISUSE) to attempt to modify this setting after | ||
| 10160 | ** the first table has been attached to the session object. | ||
| 10161 | */ | ||
| 10162 | SQLITE_API int sqlite3session_object_config(sqlite3_session*, int op, void *pArg); | ||
| 10163 | |||
| 10164 | /* | ||
| 10165 | */ | ||
| 10166 | #define SQLITE_SESSION_OBJCONFIG_SIZE 1 | ||
| 10094 | 10167 | ||
| 10095 | /* | 10168 | /* |
| 10096 | ** CAPI3REF: Enable Or Disable A Session Object | 10169 | ** CAPI3REF: Enable Or Disable A Session Object |
| @@ -10336,6 +10409,22 @@ SQLITE_API int sqlite3session_changeset( | |||
| 10336 | ); | 10409 | ); |
| 10337 | 10410 | ||
| 10338 | /* | 10411 | /* |
| 10412 | ** CAPI3REF: Return An Upper-limit For The Size Of The Changeset | ||
| 10413 | ** METHOD: sqlite3_session | ||
| 10414 | ** | ||
| 10415 | ** By default, this function always returns 0. For it to return | ||
| 10416 | ** a useful result, the sqlite3_session object must have been configured | ||
| 10417 | ** to enable this API using sqlite3session_object_config() with the | ||
| 10418 | ** SQLITE_SESSION_OBJCONFIG_SIZE verb. | ||
| 10419 | ** | ||
| 10420 | ** When enabled, this function returns an upper limit, in bytes, for the size | ||
| 10421 | ** of the changeset that might be produced if sqlite3session_changeset() were | ||
| 10422 | ** called. The final changeset size might be equal to or smaller than the | ||
| 10423 | ** size in bytes returned by this function. | ||
| 10424 | */ | ||
| 10425 | SQLITE_API sqlite3_int64 sqlite3session_changeset_size(sqlite3_session *pSession); | ||
| 10426 | |||
| 10427 | /* | ||
| 10339 | ** CAPI3REF: Load The Difference Between Tables Into A Session | 10428 | ** CAPI3REF: Load The Difference Between Tables Into A Session |
| 10340 | ** METHOD: sqlite3_session | 10429 | ** METHOD: sqlite3_session |
| 10341 | ** | 10430 | ** |