@@ -146,9 +146,9 @@ extern "C" {
146146** [sqlite3_libversion_number()], [sqlite3_sourceid()],
147147** [sqlite_version()] and [sqlite_source_id()].
148148*/
149- #define SQLITE_VERSION "3.44.2 "
150- #define SQLITE_VERSION_NUMBER 3044002
151- #define SQLITE_SOURCE_ID "2023-11-24 11:41:44 ebead0e7230cd33bcec9f95d2183069565b9e709bf745c9b5db65cc0cbf9alt1 "
149+ #define SQLITE_VERSION "3.45.3 "
150+ #define SQLITE_VERSION_NUMBER 3045003
151+ #define SQLITE_SOURCE_ID "2024-04-15 13:34:05 8653b758870e6ef0c98d46b3ace27849054af85da891eb121e9aaa537f1ealt1 "
152152
153153/*
154154** CAPI3REF: Run-Time Library Version Numbers
@@ -420,6 +420,8 @@ typedef int (*sqlite3_callback)(void*,int,char**, char**);
420420** the 1st parameter to sqlite3_exec() while sqlite3_exec() is running.
421421** <li> The application must not modify the SQL statement text passed into
422422** the 2nd parameter of sqlite3_exec() while sqlite3_exec() is running.
423+ ** <li> The application must not dereference the arrays or string pointers
424+ ** passed as the 3rd and 4th callback parameters after it returns.
423425** </ul>
424426*/
425427SQLITE_API int sqlite3_exec(
@@ -2141,6 +2143,22 @@ struct sqlite3_mem_methods {
21412143** configuration setting is never used, then the default maximum is determined
21422144** by the [SQLITE_MEMDB_DEFAULT_MAXSIZE] compile-time option. If that
21432145** compile-time option is not set, then the default maximum is 1073741824.
2146+ **
2147+ ** [[SQLITE_CONFIG_ROWID_IN_VIEW]]
2148+ ** <dt>SQLITE_CONFIG_ROWID_IN_VIEW
2149+ ** <dd>The SQLITE_CONFIG_ROWID_IN_VIEW option enables or disables the ability
2150+ ** for VIEWs to have a ROWID. The capability can only be enabled if SQLite is
2151+ ** compiled with -DSQLITE_ALLOW_ROWID_IN_VIEW, in which case the capability
2152+ ** defaults to on. This configuration option queries the current setting or
2153+ ** changes the setting to off or on. The argument is a pointer to an integer.
2154+ ** If that integer initially holds a value of 1, then the ability for VIEWs to
2155+ ** have ROWIDs is activated. If the integer initially holds zero, then the
2156+ ** ability is deactivated. Any other initial value for the integer leaves the
2157+ ** setting unchanged. After changes, if any, the integer is written with
2158+ ** a 1 or 0, if the ability for VIEWs to have ROWIDs is on or off. If SQLite
2159+ ** is compiled without -DSQLITE_ALLOW_ROWID_IN_VIEW (which is the usual and
2160+ ** recommended case) then the integer is always filled with zero, regardless
2161+ ** if its initial value.
21442162** </dl>
21452163*/
21462164#define SQLITE_CONFIG_SINGLETHREAD 1 /* nil */
@@ -2172,6 +2190,7 @@ struct sqlite3_mem_methods {
21722190#define SQLITE_CONFIG_SMALL_MALLOC 27 /* boolean */
21732191#define SQLITE_CONFIG_SORTERREF_SIZE 28 /* int nByte */
21742192#define SQLITE_CONFIG_MEMDB_MAXSIZE 29 /* sqlite3_int64 */
2193+ #define SQLITE_CONFIG_ROWID_IN_VIEW 30 /* int* */
21752194
21762195/*
21772196** CAPI3REF: Database Connection Configuration Options
@@ -3954,15 +3973,17 @@ SQLITE_API void sqlite3_free_filename(sqlite3_filename);
39543973** </ul>
39553974**
39563975** ^The sqlite3_errmsg() and sqlite3_errmsg16() return English-language
3957- ** text that describes the error, as either UTF-8 or UTF-16 respectively.
3976+ ** text that describes the error, as either UTF-8 or UTF-16 respectively,
3977+ ** or NULL if no error message is available.
39583978** (See how SQLite handles [invalid UTF] for exceptions to this rule.)
39593979** ^(Memory to hold the error message string is managed internally.
39603980** The application does not need to worry about freeing the result.
39613981** However, the error string might be overwritten or deallocated by
39623982** subsequent calls to other SQLite interface functions.)^
39633983**
3964- ** ^The sqlite3_errstr() interface returns the English-language text
3965- ** that describes the [result code], as UTF-8.
3984+ ** ^The sqlite3_errstr(E) interface returns the English-language text
3985+ ** that describes the [result code] E, as UTF-8, or NULL if E is not an
3986+ ** result code for which a text error message is available.
39663987** ^(Memory to hold the error message string is managed internally
39673988** and must not be freed by the application)^.
39683989**
@@ -8097,9 +8118,11 @@ SQLITE_API int sqlite3_vfs_unregister(sqlite3_vfs*);
80978118**
80988119** ^(Some systems (for example, Windows 95) do not support the operation
80998120** implemented by sqlite3_mutex_try(). On those systems, sqlite3_mutex_try()
8100- ** will always return SQLITE_BUSY. The SQLite core only ever uses
8101- ** sqlite3_mutex_try() as an optimization so this is acceptable
8102- ** behavior.)^
8121+ ** will always return SQLITE_BUSY. In most cases the SQLite core only uses
8122+ ** sqlite3_mutex_try() as an optimization, so this is acceptable
8123+ ** behavior. The exceptions are unix builds that set the
8124+ ** SQLITE_ENABLE_SETLK_TIMEOUT build option. In that case a working
8125+ ** sqlite3_mutex_try() is required.)^
81038126**
81048127** ^The sqlite3_mutex_leave() routine exits a mutex that was
81058128** previously entered by the same thread. The behavior
@@ -8358,6 +8381,7 @@ SQLITE_API int sqlite3_test_control(int op, ...);
83588381#define SQLITE_TESTCTRL_ASSERT 12
83598382#define SQLITE_TESTCTRL_ALWAYS 13
83608383#define SQLITE_TESTCTRL_RESERVE 14 /* NOT USED */
8384+ #define SQLITE_TESTCTRL_JSON_SELFCHECK 14
83618385#define SQLITE_TESTCTRL_OPTIMIZATIONS 15
83628386#define SQLITE_TESTCTRL_ISKEYWORD 16 /* NOT USED */
83638387#define SQLITE_TESTCTRL_SCRATCHMALLOC 17 /* NOT USED */
@@ -12871,8 +12895,11 @@ struct Fts5PhraseIter {
1287112895** created with the "columnsize=0" option.
1287212896**
1287312897** xColumnText:
12874- ** This function attempts to retrieve the text of column iCol of the
12875- ** current document. If successful, (*pz) is set to point to a buffer
12898+ ** If parameter iCol is less than zero, or greater than or equal to the
12899+ ** number of columns in the table, SQLITE_RANGE is returned.
12900+ **
12901+ ** Otherwise, this function attempts to retrieve the text of column iCol of
12902+ ** the current document. If successful, (*pz) is set to point to a buffer
1287612903** containing the text in utf-8 encoding, (*pn) is set to the size in bytes
1287712904** (not characters) of the buffer and SQLITE_OK is returned. Otherwise,
1287812905** if an error occurs, an SQLite error code is returned and the final values
@@ -12882,8 +12909,10 @@ struct Fts5PhraseIter {
1288212909** Returns the number of phrases in the current query expression.
1288312910**
1288412911** xPhraseSize:
12885- ** Returns the number of tokens in phrase iPhrase of the query. Phrases
12886- ** are numbered starting from zero.
12912+ ** If parameter iCol is less than zero, or greater than or equal to the
12913+ ** number of phrases in the current query, as returned by xPhraseCount,
12914+ ** 0 is returned. Otherwise, this function returns the number of tokens in
12915+ ** phrase iPhrase of the query. Phrases are numbered starting from zero.
1288712916**
1288812917** xInstCount:
1288912918** Set *pnInst to the total number of occurrences of all phrases within
@@ -12899,12 +12928,13 @@ struct Fts5PhraseIter {
1289912928** Query for the details of phrase match iIdx within the current row.
1290012929** Phrase matches are numbered starting from zero, so the iIdx argument
1290112930** should be greater than or equal to zero and smaller than the value
12902- ** output by xInstCount().
12931+ ** output by xInstCount(). If iIdx is less than zero or greater than
12932+ ** or equal to the value returned by xInstCount(), SQLITE_RANGE is returned.
1290312933**
12904- ** Usually , output parameter *piPhrase is set to the phrase number, *piCol
12934+ ** Otherwise , output parameter *piPhrase is set to the phrase number, *piCol
1290512935** to the column in which it occurs and *piOff the token offset of the
12906- ** first token of the phrase. Returns SQLITE_OK if successful, or an error
12907- ** code (i.e. SQLITE_NOMEM) if an error occurs.
12936+ ** first token of the phrase. SQLITE_OK is returned if successful, or an
12937+ ** error code (i.e. SQLITE_NOMEM) if an error occurs.
1290812938**
1290912939** This API can be quite slow if used with an FTS5 table created with the
1291012940** "detail=none" or "detail=column" option.
@@ -12930,6 +12960,10 @@ struct Fts5PhraseIter {
1293012960** Invoking Api.xUserData() returns a copy of the pointer passed as
1293112961** the third argument to pUserData.
1293212962**
12963+ ** If parameter iPhrase is less than zero, or greater than or equal to
12964+ ** the number of phrases in the query, as returned by xPhraseCount(),
12965+ ** this function returns SQLITE_RANGE.
12966+ **
1293312967** If the callback function returns any value other than SQLITE_OK, the
1293412968** query is abandoned and the xQueryPhrase function returns immediately.
1293512969** If the returned value is SQLITE_DONE, xQueryPhrase returns SQLITE_OK.
@@ -13044,9 +13078,42 @@ struct Fts5PhraseIter {
1304413078**
1304513079** xPhraseNextColumn()
1304613080** See xPhraseFirstColumn above.
13081+ **
13082+ ** xQueryToken(pFts5, iPhrase, iToken, ppToken, pnToken)
13083+ ** This is used to access token iToken of phrase iPhrase of the current
13084+ ** query. Before returning, output parameter *ppToken is set to point
13085+ ** to a buffer containing the requested token, and *pnToken to the
13086+ ** size of this buffer in bytes.
13087+ **
13088+ ** If iPhrase or iToken are less than zero, or if iPhrase is greater than
13089+ ** or equal to the number of phrases in the query as reported by
13090+ ** xPhraseCount(), or if iToken is equal to or greater than the number of
13091+ ** tokens in the phrase, SQLITE_RANGE is returned and *ppToken and *pnToken
13092+ are both zeroed.
13093+ **
13094+ ** The output text is not a copy of the query text that specified the
13095+ ** token. It is the output of the tokenizer module. For tokendata=1
13096+ ** tables, this includes any embedded 0x00 and trailing data.
13097+ **
13098+ ** xInstToken(pFts5, iIdx, iToken, ppToken, pnToken)
13099+ ** This is used to access token iToken of phrase hit iIdx within the
13100+ ** current row. If iIdx is less than zero or greater than or equal to the
13101+ ** value returned by xInstCount(), SQLITE_RANGE is returned. Otherwise,
13102+ ** output variable (*ppToken) is set to point to a buffer containing the
13103+ ** matching document token, and (*pnToken) to the size of that buffer in
13104+ ** bytes. This API is not available if the specified token matches a
13105+ ** prefix query term. In that case both output variables are always set
13106+ ** to 0.
13107+ **
13108+ ** The output text is not a copy of the document text that was tokenized.
13109+ ** It is the output of the tokenizer module. For tokendata=1 tables, this
13110+ ** includes any embedded 0x00 and trailing data.
13111+ **
13112+ ** This API can be quite slow if used with an FTS5 table created with the
13113+ ** "detail=none" or "detail=column" option.
1304713114*/
1304813115struct Fts5ExtensionApi {
13049- int iVersion; /* Currently always set to 2 */
13116+ int iVersion; /* Currently always set to 3 */
1305013117
1305113118 void *(*xUserData)(Fts5Context*);
1305213119
@@ -13081,6 +13148,13 @@ struct Fts5ExtensionApi {
1308113148
1308213149 int (*xPhraseFirstColumn)(Fts5Context*, int iPhrase, Fts5PhraseIter*, int*);
1308313150 void (*xPhraseNextColumn)(Fts5Context*, Fts5PhraseIter*, int *piCol);
13151+
13152+ /* Below this point are iVersion>=3 only */
13153+ int (*xQueryToken)(Fts5Context*,
13154+ int iPhrase, int iToken,
13155+ const char **ppToken, int *pnToken
13156+ );
13157+ int (*xInstToken)(Fts5Context*, int iIdx, int iToken, const char**, int*);
1308413158};
1308513159
1308613160/*
0 commit comments