@@ -147,9 +147,9 @@ extern "C" {
147
147
** [sqlite3_libversion_number()], [sqlite3_sourceid()],
148
148
** [sqlite_version()] and [sqlite_source_id()].
149
149
*/
150
- #define SQLITE_VERSION "3.45 .1"
151
- #define SQLITE_VERSION_NUMBER 3045001
152
- #define SQLITE_SOURCE_ID "2024-01-30 16:01:20 e876e51a0ed5c5b3126f52e532044363a014bc594cfefa87ffb5b82257cc467a "
150
+ #define SQLITE_VERSION "3.46 .1"
151
+ #define SQLITE_VERSION_NUMBER 3046001
152
+ #define SQLITE_SOURCE_ID "2024-08-13 09: 16:08 c9c2ab54ba1f5f46360f1b4f35d849cd3f080e6fc2b6c60e91b16c63f69a1e33 "
153
153
154
154
/*
155
155
** CAPI3REF: Run-Time Library Version Numbers
@@ -421,6 +421,8 @@ typedef int (*sqlite3_callback)(void*,int,char**, char**);
421
421
** the 1st parameter to sqlite3_exec() while sqlite3_exec() is running.
422
422
** <li> The application must not modify the SQL statement text passed into
423
423
** the 2nd parameter of sqlite3_exec() while sqlite3_exec() is running.
424
+ ** <li> The application must not dereference the arrays or string pointers
425
+ ** passed as the 3rd and 4th callback parameters after it returns.
424
426
** </ul>
425
427
*/
426
428
SQLITE_API int sqlite3_exec(
@@ -763,11 +765,11 @@ struct sqlite3_file {
763
765
** </ul>
764
766
** xLock() upgrades the database file lock. In other words, xLock() moves the
765
767
** database file lock in the direction NONE toward EXCLUSIVE. The argument to
766
- ** xLock() is always on of SHARED, RESERVED, PENDING, or EXCLUSIVE, never
768
+ ** xLock() is always one of SHARED, RESERVED, PENDING, or EXCLUSIVE, never
767
769
** SQLITE_LOCK_NONE. If the database file lock is already at or above the
768
770
** requested lock, then the call to xLock() is a no-op.
769
771
** xUnlock() downgrades the database file lock to either SHARED or NONE.
770
- * If the lock is already at or below the requested lock state, then the call
772
+ ** If the lock is already at or below the requested lock state, then the call
771
773
** to xUnlock() is a no-op.
772
774
** The xCheckReservedLock() method checks whether any database connection,
773
775
** either in this process or in some other process, is holding a RESERVED,
@@ -2142,6 +2144,22 @@ struct sqlite3_mem_methods {
2142
2144
** configuration setting is never used, then the default maximum is determined
2143
2145
** by the [SQLITE_MEMDB_DEFAULT_MAXSIZE] compile-time option. If that
2144
2146
** compile-time option is not set, then the default maximum is 1073741824.
2147
+ **
2148
+ ** [[SQLITE_CONFIG_ROWID_IN_VIEW]]
2149
+ ** <dt>SQLITE_CONFIG_ROWID_IN_VIEW
2150
+ ** <dd>The SQLITE_CONFIG_ROWID_IN_VIEW option enables or disables the ability
2151
+ ** for VIEWs to have a ROWID. The capability can only be enabled if SQLite is
2152
+ ** compiled with -DSQLITE_ALLOW_ROWID_IN_VIEW, in which case the capability
2153
+ ** defaults to on. This configuration option queries the current setting or
2154
+ ** changes the setting to off or on. The argument is a pointer to an integer.
2155
+ ** If that integer initially holds a value of 1, then the ability for VIEWs to
2156
+ ** have ROWIDs is activated. If the integer initially holds zero, then the
2157
+ ** ability is deactivated. Any other initial value for the integer leaves the
2158
+ ** setting unchanged. After changes, if any, the integer is written with
2159
+ ** a 1 or 0, if the ability for VIEWs to have ROWIDs is on or off. If SQLite
2160
+ ** is compiled without -DSQLITE_ALLOW_ROWID_IN_VIEW (which is the usual and
2161
+ ** recommended case) then the integer is always filled with zero, regardless
2162
+ ** if its initial value.
2145
2163
** </dl>
2146
2164
*/
2147
2165
#define SQLITE_CONFIG_SINGLETHREAD 1 /* nil */
@@ -2173,6 +2191,7 @@ struct sqlite3_mem_methods {
2173
2191
#define SQLITE_CONFIG_SMALL_MALLOC 27 /* boolean */
2174
2192
#define SQLITE_CONFIG_SORTERREF_SIZE 28 /* int nByte */
2175
2193
#define SQLITE_CONFIG_MEMDB_MAXSIZE 29 /* sqlite3_int64 */
2194
+ #define SQLITE_CONFIG_ROWID_IN_VIEW 30 /* int* */
2176
2195
2177
2196
/*
2178
2197
** CAPI3REF: Database Connection Configuration Options
@@ -3287,8 +3306,8 @@ SQLITE_API int sqlite3_set_authorizer(
3287
3306
#define SQLITE_RECURSIVE 33 /* NULL NULL */
3288
3307
3289
3308
/*
3290
- ** CAPI3REF: Tracing And Profiling Functions
3291
- ** METHOD: sqlite3
3309
+ ** CAPI3REF: Deprecated Tracing And Profiling Functions
3310
+ ** DEPRECATED
3292
3311
**
3293
3312
** These routines are deprecated. Use the [sqlite3_trace_v2()] interface
3294
3313
** instead of the routines described here.
@@ -6869,6 +6888,12 @@ SQLITE_API int sqlite3_autovacuum_pages(
6869
6888
** The exceptions defined in this paragraph might change in a future
6870
6889
** release of SQLite.
6871
6890
**
6891
+ ** Whether the update hook is invoked before or after the
6892
+ ** corresponding change is currently unspecified and may differ
6893
+ ** depending on the type of change. Do not rely on the order of the
6894
+ ** hook call with regards to the final result of the operation which
6895
+ ** triggers the hook.
6896
+ **
6872
6897
** The update hook implementation must not do anything that will modify
6873
6898
** the database connection that invoked the update hook. Any actions
6874
6899
** to modify the database connection must be deferred until after the
@@ -8339,7 +8364,7 @@ SQLITE_API int sqlite3_test_control(int op, ...);
8339
8364
** The sqlite3_keyword_count() interface returns the number of distinct
8340
8365
** keywords understood by SQLite.
8341
8366
**
8342
- ** The sqlite3_keyword_name(N,Z,L) interface finds the N-th keyword and
8367
+ ** The sqlite3_keyword_name(N,Z,L) interface finds the 0-based N-th keyword and
8343
8368
** makes *Z point to that keyword expressed as UTF8 and writes the number
8344
8369
** of bytes in the keyword into *L. The string that *Z points to is not
8345
8370
** zero-terminated. The sqlite3_keyword_name(N,Z,L) routine returns
@@ -9918,24 +9943,45 @@ SQLITE_API const char *sqlite3_vtab_collation(sqlite3_index_info*,int);
9918
9943
** <li value="2"><p>
9919
9944
** ^(If the sqlite3_vtab_distinct() interface returns 2, that means
9920
9945
** that the query planner does not need the rows returned in any particular
9921
- ** order, as long as rows with the same values in all "aOrderBy" columns
9922
- ** are adjacent.)^ ^(Furthermore, only a single row for each particular
9923
- ** combination of values in the columns identified by the "aOrderBy" field
9924
- ** needs to be returned.)^ ^It is always ok for two or more rows with the same
9925
- ** values in all "aOrderBy" columns to be returned, as long as all such rows
9926
- ** are adjacent. ^The virtual table may, if it chooses, omit extra rows
9927
- ** that have the same value for all columns identified by "aOrderBy".
9928
- ** ^However omitting the extra rows is optional.
9946
+ ** order, as long as rows with the same values in all columns identified
9947
+ ** by "aOrderBy" are adjacent.)^ ^(Furthermore, when two or more rows
9948
+ ** contain the same values for all columns identified by "colUsed", all but
9949
+ ** one such row may optionally be omitted from the result.)^
9950
+ ** The virtual table is not required to omit rows that are duplicates
9951
+ ** over the "colUsed" columns, but if the virtual table can do that without
9952
+ ** too much extra effort, it could potentially help the query to run faster.
9929
9953
** This mode is used for a DISTINCT query.
9930
9954
** <li value="3"><p>
9931
- ** ^(If the sqlite3_vtab_distinct() interface returns 3, that means
9932
- ** that the query planner needs only distinct rows but it does need the
9933
- ** rows to be sorted.)^ ^The virtual table implementation is free to omit
9934
- ** rows that are identical in all aOrderBy columns, if it wants to, but
9935
- ** it is not required to omit any rows. This mode is used for queries
9955
+ ** ^(If the sqlite3_vtab_distinct() interface returns 3, that means the
9956
+ ** virtual table must return rows in the order defined by "aOrderBy" as
9957
+ ** if the sqlite3_vtab_distinct() interface had returned 0. However if
9958
+ ** two or more rows in the result have the same values for all columns
9959
+ ** identified by "colUsed", then all but one such row may optionally be
9960
+ ** omitted.)^ Like when the return value is 2, the virtual table
9961
+ ** is not required to omit rows that are duplicates over the "colUsed"
9962
+ ** columns, but if the virtual table can do that without
9963
+ ** too much extra effort, it could potentially help the query to run faster.
9964
+ ** This mode is used for queries
9936
9965
** that have both DISTINCT and ORDER BY clauses.
9937
9966
** </ol>
9938
9967
**
9968
+ ** <p>The following table summarizes the conditions under which the
9969
+ ** virtual table is allowed to set the "orderByConsumed" flag based on
9970
+ ** the value returned by sqlite3_vtab_distinct(). This table is a
9971
+ ** restatement of the previous four paragraphs:
9972
+ **
9973
+ ** <table border=1 cellspacing=0 cellpadding=10 width="90%">
9974
+ ** <tr>
9975
+ ** <td valign="top">sqlite3_vtab_distinct() return value
9976
+ ** <td valign="top">Rows are returned in aOrderBy order
9977
+ ** <td valign="top">Rows with the same value in all aOrderBy columns are adjacent
9978
+ ** <td valign="top">Duplicates over all colUsed columns may be omitted
9979
+ ** <tr><td>0<td>yes<td>yes<td>no
9980
+ ** <tr><td>1<td>no<td>yes<td>no
9981
+ ** <tr><td>2<td>no<td>yes<td>yes
9982
+ ** <tr><td>3<td>yes<td>yes<td>yes
9983
+ ** </table>
9984
+ **
9939
9985
** ^For the purposes of comparing virtual table output values to see if the
9940
9986
** values are same value for sorting purposes, two NULL values are considered
9941
9987
** to be the same. In other words, the comparison operator is "IS"
@@ -11980,6 +12026,30 @@ SQLITE_API int sqlite3changegroup_schema(sqlite3_changegroup*, sqlite3*, const c
11980
12026
*/
11981
12027
SQLITE_API int sqlite3changegroup_add(sqlite3_changegroup*, int nData, void *pData);
11982
12028
12029
+ /*
12030
+ ** CAPI3REF: Add A Single Change To A Changegroup
12031
+ ** METHOD: sqlite3_changegroup
12032
+ **
12033
+ ** This function adds the single change currently indicated by the iterator
12034
+ ** passed as the second argument to the changegroup object. The rules for
12035
+ ** adding the change are just as described for [sqlite3changegroup_add()].
12036
+ **
12037
+ ** If the change is successfully added to the changegroup, SQLITE_OK is
12038
+ ** returned. Otherwise, an SQLite error code is returned.
12039
+ **
12040
+ ** The iterator must point to a valid entry when this function is called.
12041
+ ** If it does not, SQLITE_ERROR is returned and no change is added to the
12042
+ ** changegroup. Additionally, the iterator must not have been opened with
12043
+ ** the SQLITE_CHANGESETAPPLY_INVERT flag. In this case SQLITE_ERROR is also
12044
+ ** returned.
12045
+ */
12046
+ SQLITE_API int sqlite3changegroup_add_change(
12047
+ sqlite3_changegroup*,
12048
+ sqlite3_changeset_iter*
12049
+ );
12050
+
12051
+
12052
+
11983
12053
/*
11984
12054
** CAPI3REF: Obtain A Composite Changeset From A Changegroup
11985
12055
** METHOD: sqlite3_changegroup
@@ -12784,8 +12854,8 @@ struct Fts5PhraseIter {
12784
12854
** EXTENSION API FUNCTIONS
12785
12855
**
12786
12856
** xUserData(pFts):
12787
- ** Return a copy of the context pointer the extension function was
12788
- ** registered with .
12857
+ ** Return a copy of the pUserData pointer passed to the xCreateFunction()
12858
+ ** API when the extension function was registered .
12789
12859
**
12790
12860
** xColumnTotalSize(pFts, iCol, pnToken):
12791
12861
** If parameter iCol is less than zero, set output variable *pnToken
0 commit comments