@@ -123,9 +123,9 @@ extern "C" {
123123** [sqlite3_libversion_number()], [sqlite3_sourceid()],
124124** [sqlite_version()] and [sqlite_source_id()].
125125*/
126- #define SQLITE_VERSION "3.25.2 "
127- #define SQLITE_VERSION_NUMBER 3025002
128- #define SQLITE_SOURCE_ID "2018-09-25 19:08:10 fb90e7189ae6d62e77ba3a308ca5d683f90bbe633cf681865365b8e92792d1c7 "
126+ #define SQLITE_VERSION "3.26.0 "
127+ #define SQLITE_VERSION_NUMBER 3026000
128+ #define SQLITE_SOURCE_ID "2018-12-01 12:34:55 bf8c1b2b7a5960c282e543b9c293686dccff272512d08865f4600fb58238b4f9 "
129129
130130/*
131131** CAPI3REF: Run-Time Library Version Numbers
@@ -2017,6 +2017,7 @@ struct sqlite3_mem_methods {
20172017** is invoked.
20182018**
20192019** <dl>
2020+ ** [[SQLITE_DBCONFIG_LOOKASIDE]]
20202021** <dt>SQLITE_DBCONFIG_LOOKASIDE</dt>
20212022** <dd> ^This option takes three additional arguments that determine the
20222023** [lookaside memory allocator] configuration for the [database connection].
@@ -2039,6 +2040,7 @@ struct sqlite3_mem_methods {
20392040** memory is in use leaves the configuration unchanged and returns
20402041** [SQLITE_BUSY].)^</dd>
20412042**
2043+ ** [[SQLITE_DBCONFIG_ENABLE_FKEY]]
20422044** <dt>SQLITE_DBCONFIG_ENABLE_FKEY</dt>
20432045** <dd> ^This option is used to enable or disable the enforcement of
20442046** [foreign key constraints]. There should be two additional arguments.
@@ -2049,6 +2051,7 @@ struct sqlite3_mem_methods {
20492051** following this call. The second parameter may be a NULL pointer, in
20502052** which case the FK enforcement setting is not reported back. </dd>
20512053**
2054+ ** [[SQLITE_DBCONFIG_ENABLE_TRIGGER]]
20522055** <dt>SQLITE_DBCONFIG_ENABLE_TRIGGER</dt>
20532056** <dd> ^This option is used to enable or disable [CREATE TRIGGER | triggers].
20542057** There should be two additional arguments.
@@ -2059,6 +2062,7 @@ struct sqlite3_mem_methods {
20592062** following this call. The second parameter may be a NULL pointer, in
20602063** which case the trigger setting is not reported back. </dd>
20612064**
2065+ ** [[SQLITE_DBCONFIG_ENABLE_FTS3_TOKENIZER]]
20622066** <dt>SQLITE_DBCONFIG_ENABLE_FTS3_TOKENIZER</dt>
20632067** <dd> ^This option is used to enable or disable the two-argument
20642068** version of the [fts3_tokenizer()] function which is part of the
@@ -2072,6 +2076,7 @@ struct sqlite3_mem_methods {
20722076** following this call. The second parameter may be a NULL pointer, in
20732077** which case the new setting is not reported back. </dd>
20742078**
2079+ ** [[SQLITE_DBCONFIG_ENABLE_LOAD_EXTENSION]]
20752080** <dt>SQLITE_DBCONFIG_ENABLE_LOAD_EXTENSION</dt>
20762081** <dd> ^This option is used to enable or disable the [sqlite3_load_extension()]
20772082** interface independently of the [load_extension()] SQL function.
@@ -2089,7 +2094,7 @@ struct sqlite3_mem_methods {
20892094** be a NULL pointer, in which case the new setting is not reported back.
20902095** </dd>
20912096**
2092- ** <dt>SQLITE_DBCONFIG_MAINDBNAME</dt>
2097+ ** [[SQLITE_DBCONFIG_MAINDBNAME]] <dt>SQLITE_DBCONFIG_MAINDBNAME</dt>
20932098** <dd> ^This option is used to change the name of the "main" database
20942099** schema. ^The sole argument is a pointer to a constant UTF8 string
20952100** which will become the new schema name in place of "main". ^SQLite
@@ -2098,6 +2103,7 @@ struct sqlite3_mem_methods {
20982103** until after the database connection closes.
20992104** </dd>
21002105**
2106+ ** [[SQLITE_DBCONFIG_NO_CKPT_ON_CLOSE]]
21012107** <dt>SQLITE_DBCONFIG_NO_CKPT_ON_CLOSE</dt>
21022108** <dd> Usually, when a database in wal mode is closed or detached from a
21032109** database handle, SQLite checks if this will mean that there are now no
@@ -2111,7 +2117,7 @@ struct sqlite3_mem_methods {
21112117** have been disabled - 0 if they are not disabled, 1 if they are.
21122118** </dd>
21132119**
2114- ** <dt>SQLITE_DBCONFIG_ENABLE_QPSG</dt>
2120+ ** [[SQLITE_DBCONFIG_ENABLE_QPSG]] <dt>SQLITE_DBCONFIG_ENABLE_QPSG</dt>
21152121** <dd>^(The SQLITE_DBCONFIG_ENABLE_QPSG option activates or deactivates
21162122** the [query planner stability guarantee] (QPSG). When the QPSG is active,
21172123** a single SQL query statement will always use the same algorithm regardless
@@ -2127,7 +2133,7 @@ struct sqlite3_mem_methods {
21272133** following this call.
21282134** </dd>
21292135**
2130- ** <dt>SQLITE_DBCONFIG_TRIGGER_EQP</dt>
2136+ ** [[SQLITE_DBCONFIG_TRIGGER_EQP]] <dt>SQLITE_DBCONFIG_TRIGGER_EQP</dt>
21312137** <dd> By default, the output of EXPLAIN QUERY PLAN commands does not
21322138** include output for any operations performed by trigger programs. This
21332139** option is used to set or clear (the default) a flag that governs this
@@ -2139,7 +2145,7 @@ struct sqlite3_mem_methods {
21392145** it is not disabled, 1 if it is.
21402146** </dd>
21412147**
2142- ** <dt>SQLITE_DBCONFIG_RESET_DATABASE</dt>
2148+ ** [[SQLITE_DBCONFIG_RESET_DATABASE]] <dt>SQLITE_DBCONFIG_RESET_DATABASE</dt>
21432149** <dd> Set the SQLITE_DBCONFIG_RESET_DATABASE flag and then run
21442150** [VACUUM] in order to reset a database back to an empty database
21452151** with no schema and no content. The following process works even for
@@ -2158,6 +2164,18 @@ struct sqlite3_mem_methods {
21582164** Because resetting a database is destructive and irreversible, the
21592165** process requires the use of this obscure API and multiple steps to help
21602166** ensure that it does not happen by accident.
2167+ **
2168+ ** [[SQLITE_DBCONFIG_DEFENSIVE]] <dt>SQLITE_DBCONFIG_DEFENSIVE</dt>
2169+ ** <dd>The SQLITE_DBCONFIG_DEFENSIVE option activates or deactivates the
2170+ ** "defensive" flag for a database connection. When the defensive
2171+ ** flag is enabled, language features that allow ordinary SQL to
2172+ ** deliberately corrupt the database file are disabled. The disabled
2173+ ** features include but are not limited to the following:
2174+ ** <ul>
2175+ ** <li> The [PRAGMA writable_schema=ON] statement.
2176+ ** <li> Writes to the [sqlite_dbpage] virtual table.
2177+ ** <li> Direct writes to [shadow tables].
2178+ ** </ul>
21612179** </dd>
21622180** </dl>
21632181*/
@@ -2171,7 +2189,8 @@ struct sqlite3_mem_methods {
21712189#define SQLITE_DBCONFIG_ENABLE_QPSG 1007 /* int int* */
21722190#define SQLITE_DBCONFIG_TRIGGER_EQP 1008 /* int int* */
21732191#define SQLITE_DBCONFIG_RESET_DATABASE 1009 /* int int* */
2174- #define SQLITE_DBCONFIG_MAX 1009 /* Largest DBCONFIG */
2192+ #define SQLITE_DBCONFIG_DEFENSIVE 1010 /* int int* */
2193+ #define SQLITE_DBCONFIG_MAX 1010 /* Largest DBCONFIG */
21752194
21762195/*
21772196** CAPI3REF: Enable Or Disable Extended Result Codes
@@ -3609,9 +3628,19 @@ SQLITE_API int sqlite3_limit(sqlite3*, int id, int newVal);
36093628** on this hint by avoiding the use of [lookaside memory] so as not to
36103629** deplete the limited store of lookaside memory. Future versions of
36113630** SQLite may act on this hint differently.
3631+ **
3632+ ** [[SQLITE_PREPARE_NORMALIZE]] ^(<dt>SQLITE_PREPARE_NORMALIZE</dt>
3633+ ** <dd>The SQLITE_PREPARE_NORMALIZE flag indicates that a normalized
3634+ ** representation of the SQL statement should be calculated and then
3635+ ** associated with the prepared statement, which can be obtained via
3636+ ** the [sqlite3_normalized_sql()] interface.)^ The semantics used to
3637+ ** normalize a SQL statement are unspecified and subject to change.
3638+ ** At a minimum, literal values will be replaced with suitable
3639+ ** placeholders.
36123640** </dl>
36133641*/
36143642#define SQLITE_PREPARE_PERSISTENT 0x01
3643+ #define SQLITE_PREPARE_NORMALIZE 0x02
36153644
36163645/*
36173646** CAPI3REF: Compiling An SQL Statement
@@ -3769,6 +3798,11 @@ SQLITE_API int sqlite3_prepare16_v3(
37693798** ^The sqlite3_expanded_sql(P) interface returns a pointer to a UTF-8
37703799** string containing the SQL text of prepared statement P with
37713800** [bound parameters] expanded.
3801+ ** ^The sqlite3_normalized_sql(P) interface returns a pointer to a UTF-8
3802+ ** string containing the normalized SQL text of prepared statement P. The
3803+ ** semantics used to normalize a SQL statement are unspecified and subject
3804+ ** to change. At a minimum, literal values will be replaced with suitable
3805+ ** placeholders.
37723806**
37733807** ^(For example, if a prepared statement is created using the SQL
37743808** text "SELECT $abc,:xyz" and if parameter $abc is bound to integer 2345
@@ -3784,14 +3818,16 @@ SQLITE_API int sqlite3_prepare16_v3(
37843818** bound parameter expansions. ^The [SQLITE_OMIT_TRACE] compile-time
37853819** option causes sqlite3_expanded_sql() to always return NULL.
37863820**
3787- ** ^The string returned by sqlite3_sql(P) is managed by SQLite and is
3788- ** automatically freed when the prepared statement is finalized.
3821+ ** ^The strings returned by sqlite3_sql(P) and sqlite3_normalized_sql(P)
3822+ ** are managed by SQLite and are automatically freed when the prepared
3823+ ** statement is finalized.
37893824** ^The string returned by sqlite3_expanded_sql(P), on the other hand,
37903825** is obtained from [sqlite3_malloc()] and must be free by the application
37913826** by passing it to [sqlite3_free()].
37923827*/
37933828SQLITE_API const char *sqlite3_sql(sqlite3_stmt *pStmt);
37943829SQLITE_API char *sqlite3_expanded_sql(sqlite3_stmt *pStmt);
3830+ SQLITE_API const char *sqlite3_normalized_sql(sqlite3_stmt *pStmt);
37953831
37963832/*
37973833** CAPI3REF: Determine If An SQL Statement Writes The Database
@@ -6281,6 +6317,9 @@ struct sqlite3_module {
62816317 int (*xSavepoint)(sqlite3_vtab *pVTab, int);
62826318 int (*xRelease)(sqlite3_vtab *pVTab, int);
62836319 int (*xRollbackTo)(sqlite3_vtab *pVTab, int);
6320+ /* The methods above are in versions 1 and 2 of the sqlite_module object.
6321+ ** Those below are for version 3 and greater. */
6322+ int (*xShadowName)(const char*);
62846323};
62856324
62866325/*
@@ -7203,6 +7242,7 @@ SQLITE_API int sqlite3_test_control(int op, ...);
72037242#define SQLITE_TESTCTRL_OPTIMIZATIONS 15
72047243#define SQLITE_TESTCTRL_ISKEYWORD 16 /* NOT USED */
72057244#define SQLITE_TESTCTRL_SCRATCHMALLOC 17 /* NOT USED */
7245+ #define SQLITE_TESTCTRL_INTERNAL_FUNCTIONS 17
72067246#define SQLITE_TESTCTRL_LOCALTIME_FAULT 18
72077247#define SQLITE_TESTCTRL_EXPLAIN_STMT 19 /* NOT USED */
72087248#define SQLITE_TESTCTRL_ONCE_RESET_THRESHOLD 19
@@ -8615,6 +8655,7 @@ SQLITE_API int sqlite3_vtab_config(sqlite3*, int op, ...);
86158655** can use to customize and optimize their behavior.
86168656**
86178657** <dl>
8658+ ** [[SQLITE_VTAB_CONSTRAINT_SUPPORT]]
86188659** <dt>SQLITE_VTAB_CONSTRAINT_SUPPORT
86198660** <dd>Calls of the form
86208661** [sqlite3_vtab_config](db,SQLITE_VTAB_CONSTRAINT_SUPPORT,X) are supported,
@@ -9384,7 +9425,7 @@ struct sqlite3_rtree_query_info {
93849425 sqlite3_int64 iRowid; /* Rowid for current entry */
93859426 sqlite3_rtree_dbl rParentScore; /* Score of parent node */
93869427 int eParentWithin; /* Visibility of parent node */
9387- int eWithin; /* OUT: Visiblity */
9428+ int eWithin; /* OUT: Visibility */
93889429 sqlite3_rtree_dbl rScore; /* OUT: Write the score here */
93899430 /* The following fields are only available in 3.8.11 and later */
93909431 sqlite3_value **apSqlParam; /* Original SQL values of parameters */
@@ -9880,12 +9921,38 @@ SQLITE_API int sqlite3session_isempty(sqlite3_session *pSession);
98809921** consecutively. There is no chance that the iterator will visit a change
98819922** the applies to table X, then one for table Y, and then later on visit
98829923** another change for table X.
9924+ **
9925+ ** The behavior of sqlite3changeset_start_v2() and its streaming equivalent
9926+ ** may be modified by passing a combination of
9927+ ** [SQLITE_CHANGESETSTART_INVERT | supported flags] as the 4th parameter.
9928+ **
9929+ ** Note that the sqlite3changeset_start_v2() API is still <b>experimental</b>
9930+ ** and therefore subject to change.
98839931*/
98849932SQLITE_API int sqlite3changeset_start(
98859933 sqlite3_changeset_iter **pp, /* OUT: New changeset iterator handle */
98869934 int nChangeset, /* Size of changeset blob in bytes */
98879935 void *pChangeset /* Pointer to blob containing changeset */
98889936);
9937+ SQLITE_API int sqlite3changeset_start_v2(
9938+ sqlite3_changeset_iter **pp, /* OUT: New changeset iterator handle */
9939+ int nChangeset, /* Size of changeset blob in bytes */
9940+ void *pChangeset, /* Pointer to blob containing changeset */
9941+ int flags /* SESSION_CHANGESETSTART_* flags */
9942+ );
9943+
9944+ /*
9945+ ** CAPI3REF: Flags for sqlite3changeset_start_v2
9946+ **
9947+ ** The following flags may passed via the 4th parameter to
9948+ ** [sqlite3changeset_start_v2] and [sqlite3changeset_start_v2_strm]:
9949+ **
9950+ ** <dt>SQLITE_CHANGESETAPPLY_INVERT <dd>
9951+ ** Invert the changeset while iterating through it. This is equivalent to
9952+ ** inverting a changeset using sqlite3changeset_invert() before applying it.
9953+ ** It is an error to specify this flag with a patchset.
9954+ */
9955+ #define SQLITE_CHANGESETSTART_INVERT 0x0002
98899956
98909957
98919958/*
@@ -10540,7 +10607,7 @@ SQLITE_API int sqlite3changeset_apply_v2(
1054010607 ),
1054110608 void *pCtx, /* First argument passed to xConflict */
1054210609 void **ppRebase, int *pnRebase, /* OUT: Rebase data */
10543- int flags /* Combination of SESSION_APPLY_ * flags */
10610+ int flags /* SESSION_CHANGESETAPPLY_ * flags */
1054410611);
1054510612
1054610613/*
@@ -10558,8 +10625,14 @@ SQLITE_API int sqlite3changeset_apply_v2(
1055810625** causes the sessions module to omit this savepoint. In this case, if the
1055910626** caller has an open transaction or savepoint when apply_v2() is called,
1056010627** it may revert the partially applied changeset by rolling it back.
10628+ **
10629+ ** <dt>SQLITE_CHANGESETAPPLY_INVERT <dd>
10630+ ** Invert the changeset before applying it. This is equivalent to inverting
10631+ ** a changeset using sqlite3changeset_invert() before applying it. It is
10632+ ** an error to specify this flag with a patchset.
1056110633*/
1056210634#define SQLITE_CHANGESETAPPLY_NOSAVEPOINT 0x0001
10635+ #define SQLITE_CHANGESETAPPLY_INVERT 0x0002
1056310636
1056410637/*
1056510638** CAPI3REF: Constants Passed To The Conflict Handler
@@ -10953,6 +11026,12 @@ SQLITE_API int sqlite3changeset_start_strm(
1095311026 int (*xInput)(void *pIn, void *pData, int *pnData),
1095411027 void *pIn
1095511028);
11029+ SQLITE_API int sqlite3changeset_start_v2_strm(
11030+ sqlite3_changeset_iter **pp,
11031+ int (*xInput)(void *pIn, void *pData, int *pnData),
11032+ void *pIn,
11033+ int flags
11034+ );
1095611035SQLITE_API int sqlite3session_changeset_strm(
1095711036 sqlite3_session *pSession,
1095811037 int (*xOutput)(void *pOut, const void *pData, int nData),
@@ -10979,6 +11058,45 @@ SQLITE_API int sqlite3rebaser_rebase_strm(
1097911058 void *pOut
1098011059);
1098111060
11061+ /*
11062+ ** CAPI3REF: Configure global parameters
11063+ **
11064+ ** The sqlite3session_config() interface is used to make global configuration
11065+ ** changes to the sessions module in order to tune it to the specific needs
11066+ ** of the application.
11067+ **
11068+ ** The sqlite3session_config() interface is not threadsafe. If it is invoked
11069+ ** while any other thread is inside any other sessions method then the
11070+ ** results are undefined. Furthermore, if it is invoked after any sessions
11071+ ** related objects have been created, the results are also undefined.
11072+ **
11073+ ** The first argument to the sqlite3session_config() function must be one
11074+ ** of the SQLITE_SESSION_CONFIG_XXX constants defined below. The
11075+ ** interpretation of the (void*) value passed as the second parameter and
11076+ ** the effect of calling this function depends on the value of the first
11077+ ** parameter.
11078+ **
11079+ ** <dl>
11080+ ** <dt>SQLITE_SESSION_CONFIG_STRMSIZE<dd>
11081+ ** By default, the sessions module streaming interfaces attempt to input
11082+ ** and output data in approximately 1 KiB chunks. This operand may be used
11083+ ** to set and query the value of this configuration setting. The pointer
11084+ ** passed as the second argument must point to a value of type (int).
11085+ ** If this value is greater than 0, it is used as the new streaming data
11086+ ** chunk size for both input and output. Before returning, the (int) value
11087+ ** pointed to by pArg is set to the final value of the streaming interface
11088+ ** chunk size.
11089+ ** </dl>
11090+ **
11091+ ** This function returns SQLITE_OK if successful, or an SQLite error code
11092+ ** otherwise.
11093+ */
11094+ SQLITE_API int sqlite3session_config(int op, void *pArg);
11095+
11096+ /*
11097+ ** CAPI3REF: Values for sqlite3session_config().
11098+ */
11099+ #define SQLITE_SESSION_CONFIG_STRMSIZE 1
1098211100
1098311101/*
1098411102** Make sure we can call this stuff from C++.
0 commit comments