upgrade(sqlite): bundled SQLite version 3.47.1 (released 2024-11-25)

This commit is contained in:
Matej Kenda 2024-11-28 10:10:56 +01:00
parent 0930a0db3b
commit fc8a4fd702
2 changed files with 5789 additions and 2822 deletions

File diff suppressed because it is too large Load Diff

View File

@ -146,9 +146,9 @@ extern "C" {
** [sqlite3_libversion_number()], [sqlite3_sourceid()], ** [sqlite3_libversion_number()], [sqlite3_sourceid()],
** [sqlite_version()] and [sqlite_source_id()]. ** [sqlite_version()] and [sqlite_source_id()].
*/ */
#define SQLITE_VERSION "3.46.1" #define SQLITE_VERSION "3.47.1"
#define SQLITE_VERSION_NUMBER 3046001 #define SQLITE_VERSION_NUMBER 3047001
#define SQLITE_SOURCE_ID "2024-08-13 09:16:08 c9c2ab54ba1f5f46360f1b4f35d849cd3f080e6fc2b6c60e91b16c63f69a1e33" #define SQLITE_SOURCE_ID "2024-11-25 12:07:48 b95d11e958643b969c47a8e5857f3793b9e69700b8f1469371386369a26e577e"
/* /*
** CAPI3REF: Run-Time Library Version Numbers ** CAPI3REF: Run-Time Library Version Numbers
@ -652,6 +652,13 @@ SQLITE_API int sqlite3_exec(
** filesystem supports doing multiple write operations atomically when those ** filesystem supports doing multiple write operations atomically when those
** write operations are bracketed by [SQLITE_FCNTL_BEGIN_ATOMIC_WRITE] and ** write operations are bracketed by [SQLITE_FCNTL_BEGIN_ATOMIC_WRITE] and
** [SQLITE_FCNTL_COMMIT_ATOMIC_WRITE]. ** [SQLITE_FCNTL_COMMIT_ATOMIC_WRITE].
**
** The SQLITE_IOCAP_SUBPAGE_READ property means that it is ok to read
** from the database file in amounts that are not a multiple of the
** page size and that do not begin at a page boundary. Without this
** property, SQLite is careful to only do full-page reads and write
** on aligned pages, with the one exception that it will do a sub-page
** read of the first page to access the database header.
*/ */
#define SQLITE_IOCAP_ATOMIC 0x00000001 #define SQLITE_IOCAP_ATOMIC 0x00000001
#define SQLITE_IOCAP_ATOMIC512 0x00000002 #define SQLITE_IOCAP_ATOMIC512 0x00000002
@ -668,6 +675,7 @@ SQLITE_API int sqlite3_exec(
#define SQLITE_IOCAP_POWERSAFE_OVERWRITE 0x00001000 #define SQLITE_IOCAP_POWERSAFE_OVERWRITE 0x00001000
#define SQLITE_IOCAP_IMMUTABLE 0x00002000 #define SQLITE_IOCAP_IMMUTABLE 0x00002000
#define SQLITE_IOCAP_BATCH_ATOMIC 0x00004000 #define SQLITE_IOCAP_BATCH_ATOMIC 0x00004000
#define SQLITE_IOCAP_SUBPAGE_READ 0x00008000
/* /*
** CAPI3REF: File Locking Levels ** CAPI3REF: File Locking Levels
@ -772,8 +780,8 @@ struct sqlite3_file {
** to xUnlock() is a no-op. ** to xUnlock() is a no-op.
** The xCheckReservedLock() method checks whether any database connection, ** The xCheckReservedLock() method checks whether any database connection,
** either in this process or in some other process, is holding a RESERVED, ** either in this process or in some other process, is holding a RESERVED,
** PENDING, or EXCLUSIVE lock on the file. It returns true ** PENDING, or EXCLUSIVE lock on the file. It returns, via its output
** if such a lock exists and false otherwise. ** pointer parameter, true if such a lock exists and false otherwise.
** **
** The xFileControl() method is a generic interface that allows custom ** The xFileControl() method is a generic interface that allows custom
** VFS implementations to directly control an open file using the ** VFS implementations to directly control an open file using the
@ -814,6 +822,7 @@ struct sqlite3_file {
** <li> [SQLITE_IOCAP_POWERSAFE_OVERWRITE] ** <li> [SQLITE_IOCAP_POWERSAFE_OVERWRITE]
** <li> [SQLITE_IOCAP_IMMUTABLE] ** <li> [SQLITE_IOCAP_IMMUTABLE]
** <li> [SQLITE_IOCAP_BATCH_ATOMIC] ** <li> [SQLITE_IOCAP_BATCH_ATOMIC]
** <li> [SQLITE_IOCAP_SUBPAGE_READ]
** </ul> ** </ul>
** **
** The SQLITE_IOCAP_ATOMIC property means that all writes of ** The SQLITE_IOCAP_ATOMIC property means that all writes of
@ -3570,8 +3579,8 @@ SQLITE_API void sqlite3_progress_handler(sqlite3*, int, int(*)(void*), void*);
** **
** [[OPEN_EXRESCODE]] ^(<dt>[SQLITE_OPEN_EXRESCODE]</dt> ** [[OPEN_EXRESCODE]] ^(<dt>[SQLITE_OPEN_EXRESCODE]</dt>
** <dd>The database connection comes up in "extended result code mode". ** <dd>The database connection comes up in "extended result code mode".
** In other words, the database behaves has if ** In other words, the database behaves as if
** [sqlite3_extended_result_codes(db,1)] where called on the database ** [sqlite3_extended_result_codes(db,1)] were called on the database
** connection as soon as the connection is created. In addition to setting ** connection as soon as the connection is created. In addition to setting
** the extended result code mode, this flag also causes [sqlite3_open_v2()] ** the extended result code mode, this flag also causes [sqlite3_open_v2()]
** to return an extended result code.</dd> ** to return an extended result code.</dd>
@ -4222,13 +4231,17 @@ SQLITE_API int sqlite3_limit(sqlite3*, int id, int newVal);
** and sqlite3_prepare16_v3() use UTF-16. ** and sqlite3_prepare16_v3() use UTF-16.
** **
** ^If the nByte argument is negative, then zSql is read up to the ** ^If the nByte argument is negative, then zSql is read up to the
** first zero terminator. ^If nByte is positive, then it is the ** first zero terminator. ^If nByte is positive, then it is the maximum
** number of bytes read from zSql. ^If nByte is zero, then no prepared ** number of bytes read from zSql. When nByte is positive, zSql is read
** up to the first zero terminator or until the nByte bytes have been read,
** whichever comes first. ^If nByte is zero, then no prepared
** statement is generated. ** statement is generated.
** If the caller knows that the supplied string is nul-terminated, then ** If the caller knows that the supplied string is nul-terminated, then
** there is a small performance advantage to passing an nByte parameter that ** there is a small performance advantage to passing an nByte parameter that
** is the number of bytes in the input string <i>including</i> ** is the number of bytes in the input string <i>including</i>
** the nul-terminator. ** the nul-terminator.
** Note that nByte measure the length of the input in bytes, not
** characters, even for the UTF-16 interfaces.
** **
** ^If pzTail is not NULL then *pzTail is made to point to the first byte ** ^If pzTail is not NULL then *pzTail is made to point to the first byte
** past the end of the first SQL statement in zSql. These routines only ** past the end of the first SQL statement in zSql. These routines only
@ -5599,7 +5612,7 @@ SQLITE_API int sqlite3_create_window_function(
** This flag instructs SQLite to omit some corner-case optimizations that ** This flag instructs SQLite to omit some corner-case optimizations that
** might disrupt the operation of the [sqlite3_value_subtype()] function, ** might disrupt the operation of the [sqlite3_value_subtype()] function,
** causing it to return zero rather than the correct subtype(). ** causing it to return zero rather than the correct subtype().
** SQL functions that invokes [sqlite3_value_subtype()] should have this ** All SQL functions that invoke [sqlite3_value_subtype()] should have this
** property. If the SQLITE_SUBTYPE property is omitted, then the return ** property. If the SQLITE_SUBTYPE property is omitted, then the return
** value from [sqlite3_value_subtype()] might sometimes be zero even though ** value from [sqlite3_value_subtype()] might sometimes be zero even though
** a non-zero subtype was specified by the function argument expression. ** a non-zero subtype was specified by the function argument expression.
@ -5615,6 +5628,15 @@ SQLITE_API int sqlite3_create_window_function(
** [sqlite3_result_subtype()] should avoid setting this property, as the ** [sqlite3_result_subtype()] should avoid setting this property, as the
** purpose of this property is to disable certain optimizations that are ** purpose of this property is to disable certain optimizations that are
** incompatible with subtypes. ** incompatible with subtypes.
**
** [[SQLITE_SELFORDER1]] <dt>SQLITE_SELFORDER1</dt><dd>
** The SQLITE_SELFORDER1 flag indicates that the function is an aggregate
** that internally orders the values provided to the first argument. The
** ordered-set aggregate SQL notation with a single ORDER BY term can be
** used to invoke this function. If the ordered-set aggregate notation is
** used on a function that lacks this flag, then an error is raised. Note
** that the ordered-set aggregate syntax is only available if SQLite is
** built using the -DSQLITE_ENABLE_ORDERED_SET_AGGREGATES compile-time option.
** </dd> ** </dd>
** </dl> ** </dl>
*/ */
@ -5623,6 +5645,7 @@ SQLITE_API int sqlite3_create_window_function(
#define SQLITE_SUBTYPE 0x000100000 #define SQLITE_SUBTYPE 0x000100000
#define SQLITE_INNOCUOUS 0x000200000 #define SQLITE_INNOCUOUS 0x000200000
#define SQLITE_RESULT_SUBTYPE 0x001000000 #define SQLITE_RESULT_SUBTYPE 0x001000000
#define SQLITE_SELFORDER1 0x002000000
/* /*
** CAPI3REF: Deprecated Functions ** CAPI3REF: Deprecated Functions
@ -5820,7 +5843,7 @@ SQLITE_API int sqlite3_value_encoding(sqlite3_value*);
** one SQL function to another. Use the [sqlite3_result_subtype()] ** one SQL function to another. Use the [sqlite3_result_subtype()]
** routine to set the subtype for the return value of an SQL function. ** routine to set the subtype for the return value of an SQL function.
** **
** Every [application-defined SQL function] that invoke this interface ** Every [application-defined SQL function] that invokes this interface
** should include the [SQLITE_SUBTYPE] property in the text ** should include the [SQLITE_SUBTYPE] property in the text
** encoding argument when the function is [sqlite3_create_function|registered]. ** encoding argument when the function is [sqlite3_create_function|registered].
** If the [SQLITE_SUBTYPE] property is omitted, then sqlite3_value_subtype() ** If the [SQLITE_SUBTYPE] property is omitted, then sqlite3_value_subtype()
@ -7427,9 +7450,11 @@ struct sqlite3_module {
** will be returned by the strategy. ** will be returned by the strategy.
** **
** The xBestIndex method may optionally populate the idxFlags field with a ** The xBestIndex method may optionally populate the idxFlags field with a
** mask of SQLITE_INDEX_SCAN_* flags. Currently there is only one such flag - ** mask of SQLITE_INDEX_SCAN_* flags. One such flag is
** SQLITE_INDEX_SCAN_UNIQUE. If the xBestIndex method sets this flag, SQLite ** [SQLITE_INDEX_SCAN_HEX], which if set causes the [EXPLAIN QUERY PLAN]
** assumes that the strategy may visit at most one row. ** output to show the idxNum has hex instead of as decimal. Another flag is
** SQLITE_INDEX_SCAN_UNIQUE, which if set indicates that the query plan will
** return at most one row.
** **
** Additionally, if xBestIndex sets the SQLITE_INDEX_SCAN_UNIQUE flag, then ** Additionally, if xBestIndex sets the SQLITE_INDEX_SCAN_UNIQUE flag, then
** SQLite also assumes that if a call to the xUpdate() method is made as ** SQLite also assumes that if a call to the xUpdate() method is made as
@ -7493,7 +7518,9 @@ struct sqlite3_index_info {
** [sqlite3_index_info].idxFlags field to some combination of ** [sqlite3_index_info].idxFlags field to some combination of
** these bits. ** these bits.
*/ */
#define SQLITE_INDEX_SCAN_UNIQUE 1 /* Scan visits at most 1 row */ #define SQLITE_INDEX_SCAN_UNIQUE 0x00000001 /* Scan visits at most 1 row */
#define SQLITE_INDEX_SCAN_HEX 0x00000002 /* Display idxNum as hex */
/* in EXPLAIN QUERY PLAN */
/* /*
** CAPI3REF: Virtual Table Constraint Operator Codes ** CAPI3REF: Virtual Table Constraint Operator Codes
@ -8330,6 +8357,7 @@ SQLITE_API int sqlite3_test_control(int op, ...);
#define SQLITE_TESTCTRL_JSON_SELFCHECK 14 #define SQLITE_TESTCTRL_JSON_SELFCHECK 14
#define SQLITE_TESTCTRL_OPTIMIZATIONS 15 #define SQLITE_TESTCTRL_OPTIMIZATIONS 15
#define SQLITE_TESTCTRL_ISKEYWORD 16 /* NOT USED */ #define SQLITE_TESTCTRL_ISKEYWORD 16 /* NOT USED */
#define SQLITE_TESTCTRL_GETOPT 16
#define SQLITE_TESTCTRL_SCRATCHMALLOC 17 /* NOT USED */ #define SQLITE_TESTCTRL_SCRATCHMALLOC 17 /* NOT USED */
#define SQLITE_TESTCTRL_INTERNAL_FUNCTIONS 17 #define SQLITE_TESTCTRL_INTERNAL_FUNCTIONS 17
#define SQLITE_TESTCTRL_LOCALTIME_FAULT 18 #define SQLITE_TESTCTRL_LOCALTIME_FAULT 18
@ -8349,7 +8377,7 @@ SQLITE_API int sqlite3_test_control(int op, ...);
#define SQLITE_TESTCTRL_TRACEFLAGS 31 #define SQLITE_TESTCTRL_TRACEFLAGS 31
#define SQLITE_TESTCTRL_TUNE 32 #define SQLITE_TESTCTRL_TUNE 32
#define SQLITE_TESTCTRL_LOGEST 33 #define SQLITE_TESTCTRL_LOGEST 33
#define SQLITE_TESTCTRL_USELONGDOUBLE 34 #define SQLITE_TESTCTRL_USELONGDOUBLE 34 /* NOT USED */
#define SQLITE_TESTCTRL_LAST 34 /* Largest TESTCTRL */ #define SQLITE_TESTCTRL_LAST 34 /* Largest TESTCTRL */
/* /*
@ -9325,6 +9353,16 @@ typedef struct sqlite3_backup sqlite3_backup;
** APIs are not strictly speaking threadsafe. If they are invoked at the ** APIs are not strictly speaking threadsafe. If they are invoked at the
** same time as another thread is invoking sqlite3_backup_step() it is ** same time as another thread is invoking sqlite3_backup_step() it is
** possible that they return invalid values. ** possible that they return invalid values.
**
** <b>Alternatives To Using The Backup API</b>
**
** Other techniques for safely creating a consistent backup of an SQLite
** database include:
**
** <ul>
** <li> The [VACUUM INTO] command.
** <li> The [sqlite3_rsync] utility program.
** </ul>
*/ */
SQLITE_API sqlite3_backup *sqlite3_backup_init( SQLITE_API sqlite3_backup *sqlite3_backup_init(
sqlite3 *pDest, /* Destination database handle */ sqlite3 *pDest, /* Destination database handle */
@ -10524,6 +10562,14 @@ typedef struct sqlite3_snapshot {
** If there is not already a read-transaction open on schema S when ** If there is not already a read-transaction open on schema S when
** this function is called, one is opened automatically. ** this function is called, one is opened automatically.
** **
** If a read-transaction is opened by this function, then it is guaranteed
** that the returned snapshot object may not be invalidated by a database
** writer or checkpointer until after the read-transaction is closed. This
** is not guaranteed if a read-transaction is already open when this
** function is called. In that case, any subsequent write or checkpoint
** operation on the database may invalidate the returned snapshot handle,
** even while the read-transaction remains open.
**
** The following must be true for this function to succeed. If any of ** The following must be true for this function to succeed. If any of
** the following statements are false when sqlite3_snapshot_get() is ** the following statements are false when sqlite3_snapshot_get() is
** called, SQLITE_ERROR is returned. The final value of *P is undefined ** called, SQLITE_ERROR is returned. The final value of *P is undefined
@ -10832,8 +10878,6 @@ SQLITE_API int sqlite3_deserialize(
#if defined(__wasi__) #if defined(__wasi__)
# undef SQLITE_WASI # undef SQLITE_WASI
# define SQLITE_WASI 1 # define SQLITE_WASI 1
# undef SQLITE_OMIT_WAL
# define SQLITE_OMIT_WAL 1/* because it requires shared memory APIs */
# ifndef SQLITE_OMIT_LOAD_EXTENSION # ifndef SQLITE_OMIT_LOAD_EXTENSION
# define SQLITE_OMIT_LOAD_EXTENSION # define SQLITE_OMIT_LOAD_EXTENSION
# endif # endif
@ -13036,6 +13080,10 @@ struct Fts5PhraseIter {
** (i.e. if it is a contentless table), then this API always iterates ** (i.e. if it is a contentless table), then this API always iterates
** through an empty set (all calls to xPhraseFirst() set iCol to -1). ** through an empty set (all calls to xPhraseFirst() set iCol to -1).
** **
** In all cases, matches are visited in (column ASC, offset ASC) order.
** i.e. all those in column 0, sorted by offset, followed by those in
** column 1, etc.
**
** xPhraseNext() ** xPhraseNext()
** See xPhraseFirst above. ** See xPhraseFirst above.
** **
@ -13102,9 +13150,32 @@ struct Fts5PhraseIter {
** **
** This API can be quite slow if used with an FTS5 table created with the ** This API can be quite slow if used with an FTS5 table created with the
** "detail=none" or "detail=column" option. ** "detail=none" or "detail=column" option.
**
** xColumnLocale(pFts5, iIdx, pzLocale, pnLocale)
** If parameter iCol is less than zero, or greater than or equal to the
** number of columns in the table, SQLITE_RANGE is returned.
**
** Otherwise, this function attempts to retrieve the locale associated
** with column iCol of the current row. Usually, there is no associated
** locale, and output parameters (*pzLocale) and (*pnLocale) are set
** to NULL and 0, respectively. However, if the fts5_locale() function
** was used to associate a locale with the value when it was inserted
** into the fts5 table, then (*pzLocale) is set to point to a nul-terminated
** buffer containing the name of the locale in utf-8 encoding. (*pnLocale)
** is set to the size in bytes of the buffer, not including the
** nul-terminator.
**
** If successful, SQLITE_OK is returned. Or, if an error occurs, an
** SQLite error code is returned. The final value of the output parameters
** is undefined in this case.
**
** xTokenize_v2:
** Tokenize text using the tokenizer belonging to the FTS5 table. This
** API is the same as the xTokenize() API, except that it allows a tokenizer
** locale to be specified.
*/ */
struct Fts5ExtensionApi { struct Fts5ExtensionApi {
int iVersion; /* Currently always set to 3 */ int iVersion; /* Currently always set to 4 */
void *(*xUserData)(Fts5Context*); void *(*xUserData)(Fts5Context*);
@ -13146,6 +13217,15 @@ struct Fts5ExtensionApi {
const char **ppToken, int *pnToken const char **ppToken, int *pnToken
); );
int (*xInstToken)(Fts5Context*, int iIdx, int iToken, const char**, int*); int (*xInstToken)(Fts5Context*, int iIdx, int iToken, const char**, int*);
/* Below this point are iVersion>=4 only */
int (*xColumnLocale)(Fts5Context*, int iCol, const char **pz, int *pn);
int (*xTokenize_v2)(Fts5Context*,
const char *pText, int nText, /* Text to tokenize */
const char *pLocale, int nLocale, /* Locale to pass to tokenizer */
void *pCtx, /* Context passed to xToken() */
int (*xToken)(void*, int, const char*, int, int, int) /* Callback */
);
}; };
/* /*
@ -13166,7 +13246,7 @@ struct Fts5ExtensionApi {
** A tokenizer instance is required to actually tokenize text. ** A tokenizer instance is required to actually tokenize text.
** **
** The first argument passed to this function is a copy of the (void*) ** The first argument passed to this function is a copy of the (void*)
** pointer provided by the application when the fts5_tokenizer object ** pointer provided by the application when the fts5_tokenizer_v2 object
** was registered with FTS5 (the third argument to xCreateTokenizer()). ** was registered with FTS5 (the third argument to xCreateTokenizer()).
** The second and third arguments are an array of nul-terminated strings ** The second and third arguments are an array of nul-terminated strings
** containing the tokenizer arguments, if any, specified following the ** containing the tokenizer arguments, if any, specified following the
@ -13190,7 +13270,7 @@ struct Fts5ExtensionApi {
** argument passed to this function is a pointer to an Fts5Tokenizer object ** argument passed to this function is a pointer to an Fts5Tokenizer object
** returned by an earlier call to xCreate(). ** returned by an earlier call to xCreate().
** **
** The second argument indicates the reason that FTS5 is requesting ** The third argument indicates the reason that FTS5 is requesting
** tokenization of the supplied text. This is always one of the following ** tokenization of the supplied text. This is always one of the following
** four values: ** four values:
** **
@ -13214,6 +13294,13 @@ struct Fts5ExtensionApi {
** on a columnsize=0 database. ** on a columnsize=0 database.
** </ul> ** </ul>
** **
** The sixth and seventh arguments passed to xTokenize() - pLocale and
** nLocale - are a pointer to a buffer containing the locale to use for
** tokenization (e.g. "en_US") and its size in bytes, respectively. The
** pLocale buffer is not nul-terminated. pLocale may be passed NULL (in
** which case nLocale is always 0) to indicate that the tokenizer should
** use its default locale.
**
** For each token in the input string, the supplied callback xToken() must ** For each token in the input string, the supplied callback xToken() must
** be invoked. The first argument to it should be a copy of the pointer ** be invoked. The first argument to it should be a copy of the pointer
** passed as the second argument to xTokenize(). The third and fourth ** passed as the second argument to xTokenize(). The third and fourth
@ -13237,6 +13324,30 @@ struct Fts5ExtensionApi {
** may abandon the tokenization and return any error code other than ** may abandon the tokenization and return any error code other than
** SQLITE_OK or SQLITE_DONE. ** SQLITE_OK or SQLITE_DONE.
** **
** If the tokenizer is registered using an fts5_tokenizer_v2 object,
** then the xTokenize() method has two additional arguments - pLocale
** and nLocale. These specify the locale that the tokenizer should use
** for the current request. If pLocale and nLocale are both 0, then the
** tokenizer should use its default locale. Otherwise, pLocale points to
** an nLocale byte buffer containing the name of the locale to use as utf-8
** text. pLocale is not nul-terminated.
**
** FTS5_TOKENIZER
**
** There is also an fts5_tokenizer object. This is an older, deprecated,
** version of fts5_tokenizer_v2. It is similar except that:
**
** <ul>
** <li> There is no "iVersion" field, and
** <li> The xTokenize() method does not take a locale argument.
** </ul>
**
** Legacy fts5_tokenizer tokenizers must be registered using the
** legacy xCreateTokenizer() function, instead of xCreateTokenizer_v2().
**
** Tokenizer implementations registered using either API may be retrieved
** using both xFindTokenizer() and xFindTokenizer_v2().
**
** SYNONYM SUPPORT ** SYNONYM SUPPORT
** **
** Custom tokenizers may also support synonyms. Consider a case in which a ** Custom tokenizers may also support synonyms. Consider a case in which a
@ -13345,6 +13456,33 @@ struct Fts5ExtensionApi {
** inefficient. ** inefficient.
*/ */
typedef struct Fts5Tokenizer Fts5Tokenizer; typedef struct Fts5Tokenizer Fts5Tokenizer;
typedef struct fts5_tokenizer_v2 fts5_tokenizer_v2;
struct fts5_tokenizer_v2 {
int iVersion; /* Currently always 2 */
int (*xCreate)(void*, const char **azArg, int nArg, Fts5Tokenizer **ppOut);
void (*xDelete)(Fts5Tokenizer*);
int (*xTokenize)(Fts5Tokenizer*,
void *pCtx,
int flags, /* Mask of FTS5_TOKENIZE_* flags */
const char *pText, int nText,
const char *pLocale, int nLocale,
int (*xToken)(
void *pCtx, /* Copy of 2nd argument to xTokenize() */
int tflags, /* Mask of FTS5_TOKEN_* flags */
const char *pToken, /* Pointer to buffer containing token */
int nToken, /* Size of token in bytes */
int iStart, /* Byte offset of token within input text */
int iEnd /* Byte offset of end of token within input text */
)
);
};
/*
** New code should use the fts5_tokenizer_v2 type to define tokenizer
** implementations. The following type is included for legacy applications
** that still use it.
*/
typedef struct fts5_tokenizer fts5_tokenizer; typedef struct fts5_tokenizer fts5_tokenizer;
struct fts5_tokenizer { struct fts5_tokenizer {
int (*xCreate)(void*, const char **azArg, int nArg, Fts5Tokenizer **ppOut); int (*xCreate)(void*, const char **azArg, int nArg, Fts5Tokenizer **ppOut);
@ -13364,6 +13502,7 @@ struct fts5_tokenizer {
); );
}; };
/* Flags that may be passed as the third argument to xTokenize() */ /* Flags that may be passed as the third argument to xTokenize() */
#define FTS5_TOKENIZE_QUERY 0x0001 #define FTS5_TOKENIZE_QUERY 0x0001
#define FTS5_TOKENIZE_PREFIX 0x0002 #define FTS5_TOKENIZE_PREFIX 0x0002
@ -13383,7 +13522,7 @@ struct fts5_tokenizer {
*/ */
typedef struct fts5_api fts5_api; typedef struct fts5_api fts5_api;
struct fts5_api { struct fts5_api {
int iVersion; /* Currently always set to 2 */ int iVersion; /* Currently always set to 3 */
/* Create a new tokenizer */ /* Create a new tokenizer */
int (*xCreateTokenizer)( int (*xCreateTokenizer)(
@ -13410,6 +13549,25 @@ struct fts5_api {
fts5_extension_function xFunction, fts5_extension_function xFunction,
void (*xDestroy)(void*) void (*xDestroy)(void*)
); );
/* APIs below this point are only available if iVersion>=3 */
/* Create a new tokenizer */
int (*xCreateTokenizer_v2)(
fts5_api *pApi,
const char *zName,
void *pUserData,
fts5_tokenizer_v2 *pTokenizer,
void (*xDestroy)(void*)
);
/* Find an existing tokenizer */
int (*xFindTokenizer_v2)(
fts5_api *pApi,
const char *zName,
void **ppUserData,
fts5_tokenizer_v2 **ppTokenizer
);
}; };
/* /*