better-sqlite3-multiple-ciphers 11.3.0 → 11.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -4
- package/deps/setup.ps1 +1 -1
- package/deps/sqlite3/sqlite3.c +6348 -3000
- package/deps/sqlite3/sqlite3.h +178 -29
- package/package.json +1 -1
package/deps/sqlite3/sqlite3.h
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
** Purpose: Header file for SQLite3 Multiple Ciphers support
|
|
4
4
|
** Author: Ulrich Telle
|
|
5
5
|
** Created: 2020-03-01
|
|
6
|
-
** Copyright: (c) 2019-
|
|
6
|
+
** Copyright: (c) 2019-2024 Ulrich Telle
|
|
7
7
|
** License: MIT
|
|
8
8
|
*/
|
|
9
9
|
|
|
@@ -30,10 +30,10 @@
|
|
|
30
30
|
#define SQLITE3MC_VERSION_H_
|
|
31
31
|
|
|
32
32
|
#define SQLITE3MC_VERSION_MAJOR 1
|
|
33
|
-
#define SQLITE3MC_VERSION_MINOR
|
|
34
|
-
#define SQLITE3MC_VERSION_RELEASE
|
|
33
|
+
#define SQLITE3MC_VERSION_MINOR 9
|
|
34
|
+
#define SQLITE3MC_VERSION_RELEASE 0
|
|
35
35
|
#define SQLITE3MC_VERSION_SUBRELEASE 0
|
|
36
|
-
#define SQLITE3MC_VERSION_STRING "SQLite3 Multiple Ciphers 1.
|
|
36
|
+
#define SQLITE3MC_VERSION_STRING "SQLite3 Multiple Ciphers 1.9.0"
|
|
37
37
|
|
|
38
38
|
#endif /* SQLITE3MC_VERSION_H_ */
|
|
39
39
|
/*** End of #include "sqlite3mc_version.h" ***/
|
|
@@ -192,9 +192,9 @@ extern "C" {
|
|
|
192
192
|
** [sqlite3_libversion_number()], [sqlite3_sourceid()],
|
|
193
193
|
** [sqlite_version()] and [sqlite_source_id()].
|
|
194
194
|
*/
|
|
195
|
-
#define SQLITE_VERSION "3.
|
|
196
|
-
#define SQLITE_VERSION_NUMBER
|
|
197
|
-
#define SQLITE_SOURCE_ID "2024-
|
|
195
|
+
#define SQLITE_VERSION "3.47.0"
|
|
196
|
+
#define SQLITE_VERSION_NUMBER 3047000
|
|
197
|
+
#define SQLITE_SOURCE_ID "2024-10-21 16:30:22 03a9703e27c44437c39363d0baf82db4ebc94538a0f28411c85dda156f82636e"
|
|
198
198
|
|
|
199
199
|
/*
|
|
200
200
|
** CAPI3REF: Run-Time Library Version Numbers
|
|
@@ -818,8 +818,8 @@ struct sqlite3_file {
|
|
|
818
818
|
** to xUnlock() is a no-op.
|
|
819
819
|
** The xCheckReservedLock() method checks whether any database connection,
|
|
820
820
|
** either in this process or in some other process, is holding a RESERVED,
|
|
821
|
-
** PENDING, or EXCLUSIVE lock on the file. It returns
|
|
822
|
-
** if such a lock exists and false otherwise.
|
|
821
|
+
** PENDING, or EXCLUSIVE lock on the file. It returns, via its output
|
|
822
|
+
** pointer parameter, true if such a lock exists and false otherwise.
|
|
823
823
|
**
|
|
824
824
|
** The xFileControl() method is a generic interface that allows custom
|
|
825
825
|
** VFS implementations to directly control an open file using the
|
|
@@ -3616,8 +3616,8 @@ SQLITE_API void sqlite3_progress_handler(sqlite3*, int, int(*)(void*), void*);
|
|
|
3616
3616
|
**
|
|
3617
3617
|
** [[OPEN_EXRESCODE]] ^(<dt>[SQLITE_OPEN_EXRESCODE]</dt>
|
|
3618
3618
|
** <dd>The database connection comes up in "extended result code mode".
|
|
3619
|
-
** In other words, the database behaves
|
|
3620
|
-
** [sqlite3_extended_result_codes(db,1)]
|
|
3619
|
+
** In other words, the database behaves as if
|
|
3620
|
+
** [sqlite3_extended_result_codes(db,1)] were called on the database
|
|
3621
3621
|
** connection as soon as the connection is created. In addition to setting
|
|
3622
3622
|
** the extended result code mode, this flag also causes [sqlite3_open_v2()]
|
|
3623
3623
|
** to return an extended result code.</dd>
|
|
@@ -4268,13 +4268,17 @@ SQLITE_API int sqlite3_limit(sqlite3*, int id, int newVal);
|
|
|
4268
4268
|
** and sqlite3_prepare16_v3() use UTF-16.
|
|
4269
4269
|
**
|
|
4270
4270
|
** ^If the nByte argument is negative, then zSql is read up to the
|
|
4271
|
-
** first zero terminator. ^If nByte is positive, then it is the
|
|
4272
|
-
** number of bytes read from zSql.
|
|
4271
|
+
** first zero terminator. ^If nByte is positive, then it is the maximum
|
|
4272
|
+
** number of bytes read from zSql. When nByte is positive, zSql is read
|
|
4273
|
+
** up to the first zero terminator or until the nByte bytes have been read,
|
|
4274
|
+
** whichever comes first. ^If nByte is zero, then no prepared
|
|
4273
4275
|
** statement is generated.
|
|
4274
4276
|
** If the caller knows that the supplied string is nul-terminated, then
|
|
4275
4277
|
** there is a small performance advantage to passing an nByte parameter that
|
|
4276
4278
|
** is the number of bytes in the input string <i>including</i>
|
|
4277
4279
|
** the nul-terminator.
|
|
4280
|
+
** Note that nByte measure the length of the input in bytes, not
|
|
4281
|
+
** characters, even for the UTF-16 interfaces.
|
|
4278
4282
|
**
|
|
4279
4283
|
** ^If pzTail is not NULL then *pzTail is made to point to the first byte
|
|
4280
4284
|
** past the end of the first SQL statement in zSql. These routines only
|
|
@@ -5645,7 +5649,7 @@ SQLITE_API int sqlite3_create_window_function(
|
|
|
5645
5649
|
** This flag instructs SQLite to omit some corner-case optimizations that
|
|
5646
5650
|
** might disrupt the operation of the [sqlite3_value_subtype()] function,
|
|
5647
5651
|
** causing it to return zero rather than the correct subtype().
|
|
5648
|
-
** SQL functions that
|
|
5652
|
+
** All SQL functions that invoke [sqlite3_value_subtype()] should have this
|
|
5649
5653
|
** property. If the SQLITE_SUBTYPE property is omitted, then the return
|
|
5650
5654
|
** value from [sqlite3_value_subtype()] might sometimes be zero even though
|
|
5651
5655
|
** a non-zero subtype was specified by the function argument expression.
|
|
@@ -5661,6 +5665,15 @@ SQLITE_API int sqlite3_create_window_function(
|
|
|
5661
5665
|
** [sqlite3_result_subtype()] should avoid setting this property, as the
|
|
5662
5666
|
** purpose of this property is to disable certain optimizations that are
|
|
5663
5667
|
** incompatible with subtypes.
|
|
5668
|
+
**
|
|
5669
|
+
** [[SQLITE_SELFORDER1]] <dt>SQLITE_SELFORDER1</dt><dd>
|
|
5670
|
+
** The SQLITE_SELFORDER1 flag indicates that the function is an aggregate
|
|
5671
|
+
** that internally orders the values provided to the first argument. The
|
|
5672
|
+
** ordered-set aggregate SQL notation with a single ORDER BY term can be
|
|
5673
|
+
** used to invoke this function. If the ordered-set aggregate notation is
|
|
5674
|
+
** used on a function that lacks this flag, then an error is raised. Note
|
|
5675
|
+
** that the ordered-set aggregate syntax is only available if SQLite is
|
|
5676
|
+
** built using the -DSQLITE_ENABLE_ORDERED_SET_AGGREGATES compile-time option.
|
|
5664
5677
|
** </dd>
|
|
5665
5678
|
** </dl>
|
|
5666
5679
|
*/
|
|
@@ -5669,6 +5682,7 @@ SQLITE_API int sqlite3_create_window_function(
|
|
|
5669
5682
|
#define SQLITE_SUBTYPE 0x000100000
|
|
5670
5683
|
#define SQLITE_INNOCUOUS 0x000200000
|
|
5671
5684
|
#define SQLITE_RESULT_SUBTYPE 0x001000000
|
|
5685
|
+
#define SQLITE_SELFORDER1 0x002000000
|
|
5672
5686
|
|
|
5673
5687
|
/*
|
|
5674
5688
|
** CAPI3REF: Deprecated Functions
|
|
@@ -5866,7 +5880,7 @@ SQLITE_API int sqlite3_value_encoding(sqlite3_value*);
|
|
|
5866
5880
|
** one SQL function to another. Use the [sqlite3_result_subtype()]
|
|
5867
5881
|
** routine to set the subtype for the return value of an SQL function.
|
|
5868
5882
|
**
|
|
5869
|
-
** Every [application-defined SQL function] that
|
|
5883
|
+
** Every [application-defined SQL function] that invokes this interface
|
|
5870
5884
|
** should include the [SQLITE_SUBTYPE] property in the text
|
|
5871
5885
|
** encoding argument when the function is [sqlite3_create_function|registered].
|
|
5872
5886
|
** If the [SQLITE_SUBTYPE] property is omitted, then sqlite3_value_subtype()
|
|
@@ -7473,9 +7487,11 @@ struct sqlite3_module {
|
|
|
7473
7487
|
** will be returned by the strategy.
|
|
7474
7488
|
**
|
|
7475
7489
|
** The xBestIndex method may optionally populate the idxFlags field with a
|
|
7476
|
-
** mask of SQLITE_INDEX_SCAN_* flags.
|
|
7477
|
-
**
|
|
7478
|
-
**
|
|
7490
|
+
** mask of SQLITE_INDEX_SCAN_* flags. One such flag is
|
|
7491
|
+
** [SQLITE_INDEX_SCAN_HEX], which if set causes the [EXPLAIN QUERY PLAN]
|
|
7492
|
+
** output to show the idxNum has hex instead of as decimal. Another flag is
|
|
7493
|
+
** SQLITE_INDEX_SCAN_UNIQUE, which if set indicates that the query plan will
|
|
7494
|
+
** return at most one row.
|
|
7479
7495
|
**
|
|
7480
7496
|
** Additionally, if xBestIndex sets the SQLITE_INDEX_SCAN_UNIQUE flag, then
|
|
7481
7497
|
** SQLite also assumes that if a call to the xUpdate() method is made as
|
|
@@ -7539,7 +7555,9 @@ struct sqlite3_index_info {
|
|
|
7539
7555
|
** [sqlite3_index_info].idxFlags field to some combination of
|
|
7540
7556
|
** these bits.
|
|
7541
7557
|
*/
|
|
7542
|
-
#define SQLITE_INDEX_SCAN_UNIQUE
|
|
7558
|
+
#define SQLITE_INDEX_SCAN_UNIQUE 0x00000001 /* Scan visits at most 1 row */
|
|
7559
|
+
#define SQLITE_INDEX_SCAN_HEX 0x00000002 /* Display idxNum as hex */
|
|
7560
|
+
/* in EXPLAIN QUERY PLAN */
|
|
7543
7561
|
|
|
7544
7562
|
/*
|
|
7545
7563
|
** CAPI3REF: Virtual Table Constraint Operator Codes
|
|
@@ -8376,6 +8394,7 @@ SQLITE_API int sqlite3_test_control(int op, ...);
|
|
|
8376
8394
|
#define SQLITE_TESTCTRL_JSON_SELFCHECK 14
|
|
8377
8395
|
#define SQLITE_TESTCTRL_OPTIMIZATIONS 15
|
|
8378
8396
|
#define SQLITE_TESTCTRL_ISKEYWORD 16 /* NOT USED */
|
|
8397
|
+
#define SQLITE_TESTCTRL_GETOPT 16
|
|
8379
8398
|
#define SQLITE_TESTCTRL_SCRATCHMALLOC 17 /* NOT USED */
|
|
8380
8399
|
#define SQLITE_TESTCTRL_INTERNAL_FUNCTIONS 17
|
|
8381
8400
|
#define SQLITE_TESTCTRL_LOCALTIME_FAULT 18
|
|
@@ -8395,7 +8414,7 @@ SQLITE_API int sqlite3_test_control(int op, ...);
|
|
|
8395
8414
|
#define SQLITE_TESTCTRL_TRACEFLAGS 31
|
|
8396
8415
|
#define SQLITE_TESTCTRL_TUNE 32
|
|
8397
8416
|
#define SQLITE_TESTCTRL_LOGEST 33
|
|
8398
|
-
#define SQLITE_TESTCTRL_USELONGDOUBLE 34
|
|
8417
|
+
#define SQLITE_TESTCTRL_USELONGDOUBLE 34 /* NOT USED */
|
|
8399
8418
|
#define SQLITE_TESTCTRL_LAST 34 /* Largest TESTCTRL */
|
|
8400
8419
|
|
|
8401
8420
|
/*
|
|
@@ -9371,6 +9390,16 @@ typedef struct sqlite3_backup sqlite3_backup;
|
|
|
9371
9390
|
** APIs are not strictly speaking threadsafe. If they are invoked at the
|
|
9372
9391
|
** same time as another thread is invoking sqlite3_backup_step() it is
|
|
9373
9392
|
** possible that they return invalid values.
|
|
9393
|
+
**
|
|
9394
|
+
** <b>Alternatives To Using The Backup API</b>
|
|
9395
|
+
**
|
|
9396
|
+
** Other techniques for safely creating a consistent backup of an SQLite
|
|
9397
|
+
** database include:
|
|
9398
|
+
**
|
|
9399
|
+
** <ul>
|
|
9400
|
+
** <li> The [VACUUM INTO] command.
|
|
9401
|
+
** <li> The [sqlite3_rsync] utility program.
|
|
9402
|
+
** </ul>
|
|
9374
9403
|
*/
|
|
9375
9404
|
SQLITE_API sqlite3_backup *sqlite3_backup_init(
|
|
9376
9405
|
sqlite3 *pDest, /* Destination database handle */
|
|
@@ -10570,6 +10599,14 @@ typedef struct sqlite3_snapshot {
|
|
|
10570
10599
|
** If there is not already a read-transaction open on schema S when
|
|
10571
10600
|
** this function is called, one is opened automatically.
|
|
10572
10601
|
**
|
|
10602
|
+
** If a read-transaction is opened by this function, then it is guaranteed
|
|
10603
|
+
** that the returned snapshot object may not be invalidated by a database
|
|
10604
|
+
** writer or checkpointer until after the read-transaction is closed. This
|
|
10605
|
+
** is not guaranteed if a read-transaction is already open when this
|
|
10606
|
+
** function is called. In that case, any subsequent write or checkpoint
|
|
10607
|
+
** operation on the database may invalidate the returned snapshot handle,
|
|
10608
|
+
** even while the read-transaction remains open.
|
|
10609
|
+
**
|
|
10573
10610
|
** The following must be true for this function to succeed. If any of
|
|
10574
10611
|
** the following statements are false when sqlite3_snapshot_get() is
|
|
10575
10612
|
** called, SQLITE_ERROR is returned. The final value of *P is undefined
|
|
@@ -10878,8 +10915,6 @@ SQLITE_API int sqlite3_deserialize(
|
|
|
10878
10915
|
#if defined(__wasi__)
|
|
10879
10916
|
# undef SQLITE_WASI
|
|
10880
10917
|
# define SQLITE_WASI 1
|
|
10881
|
-
# undef SQLITE_OMIT_WAL
|
|
10882
|
-
# define SQLITE_OMIT_WAL 1/* because it requires shared memory APIs */
|
|
10883
10918
|
# ifndef SQLITE_OMIT_LOAD_EXTENSION
|
|
10884
10919
|
# define SQLITE_OMIT_LOAD_EXTENSION
|
|
10885
10920
|
# endif
|
|
@@ -13082,6 +13117,10 @@ struct Fts5PhraseIter {
|
|
|
13082
13117
|
** (i.e. if it is a contentless table), then this API always iterates
|
|
13083
13118
|
** through an empty set (all calls to xPhraseFirst() set iCol to -1).
|
|
13084
13119
|
**
|
|
13120
|
+
** In all cases, matches are visited in (column ASC, offset ASC) order.
|
|
13121
|
+
** i.e. all those in column 0, sorted by offset, followed by those in
|
|
13122
|
+
** column 1, etc.
|
|
13123
|
+
**
|
|
13085
13124
|
** xPhraseNext()
|
|
13086
13125
|
** See xPhraseFirst above.
|
|
13087
13126
|
**
|
|
@@ -13148,9 +13187,32 @@ struct Fts5PhraseIter {
|
|
|
13148
13187
|
**
|
|
13149
13188
|
** This API can be quite slow if used with an FTS5 table created with the
|
|
13150
13189
|
** "detail=none" or "detail=column" option.
|
|
13190
|
+
**
|
|
13191
|
+
** xColumnLocale(pFts5, iIdx, pzLocale, pnLocale)
|
|
13192
|
+
** If parameter iCol is less than zero, or greater than or equal to the
|
|
13193
|
+
** number of columns in the table, SQLITE_RANGE is returned.
|
|
13194
|
+
**
|
|
13195
|
+
** Otherwise, this function attempts to retrieve the locale associated
|
|
13196
|
+
** with column iCol of the current row. Usually, there is no associated
|
|
13197
|
+
** locale, and output parameters (*pzLocale) and (*pnLocale) are set
|
|
13198
|
+
** to NULL and 0, respectively. However, if the fts5_locale() function
|
|
13199
|
+
** was used to associate a locale with the value when it was inserted
|
|
13200
|
+
** into the fts5 table, then (*pzLocale) is set to point to a nul-terminated
|
|
13201
|
+
** buffer containing the name of the locale in utf-8 encoding. (*pnLocale)
|
|
13202
|
+
** is set to the size in bytes of the buffer, not including the
|
|
13203
|
+
** nul-terminator.
|
|
13204
|
+
**
|
|
13205
|
+
** If successful, SQLITE_OK is returned. Or, if an error occurs, an
|
|
13206
|
+
** SQLite error code is returned. The final value of the output parameters
|
|
13207
|
+
** is undefined in this case.
|
|
13208
|
+
**
|
|
13209
|
+
** xTokenize_v2:
|
|
13210
|
+
** Tokenize text using the tokenizer belonging to the FTS5 table. This
|
|
13211
|
+
** API is the same as the xTokenize() API, except that it allows a tokenizer
|
|
13212
|
+
** locale to be specified.
|
|
13151
13213
|
*/
|
|
13152
13214
|
struct Fts5ExtensionApi {
|
|
13153
|
-
int iVersion; /* Currently always set to
|
|
13215
|
+
int iVersion; /* Currently always set to 4 */
|
|
13154
13216
|
|
|
13155
13217
|
void *(*xUserData)(Fts5Context*);
|
|
13156
13218
|
|
|
@@ -13192,6 +13254,15 @@ struct Fts5ExtensionApi {
|
|
|
13192
13254
|
const char **ppToken, int *pnToken
|
|
13193
13255
|
);
|
|
13194
13256
|
int (*xInstToken)(Fts5Context*, int iIdx, int iToken, const char**, int*);
|
|
13257
|
+
|
|
13258
|
+
/* Below this point are iVersion>=4 only */
|
|
13259
|
+
int (*xColumnLocale)(Fts5Context*, int iCol, const char **pz, int *pn);
|
|
13260
|
+
int (*xTokenize_v2)(Fts5Context*,
|
|
13261
|
+
const char *pText, int nText, /* Text to tokenize */
|
|
13262
|
+
const char *pLocale, int nLocale, /* Locale to pass to tokenizer */
|
|
13263
|
+
void *pCtx, /* Context passed to xToken() */
|
|
13264
|
+
int (*xToken)(void*, int, const char*, int, int, int) /* Callback */
|
|
13265
|
+
);
|
|
13195
13266
|
};
|
|
13196
13267
|
|
|
13197
13268
|
/*
|
|
@@ -13212,7 +13283,7 @@ struct Fts5ExtensionApi {
|
|
|
13212
13283
|
** A tokenizer instance is required to actually tokenize text.
|
|
13213
13284
|
**
|
|
13214
13285
|
** The first argument passed to this function is a copy of the (void*)
|
|
13215
|
-
** pointer provided by the application when the
|
|
13286
|
+
** pointer provided by the application when the fts5_tokenizer_v2 object
|
|
13216
13287
|
** was registered with FTS5 (the third argument to xCreateTokenizer()).
|
|
13217
13288
|
** The second and third arguments are an array of nul-terminated strings
|
|
13218
13289
|
** containing the tokenizer arguments, if any, specified following the
|
|
@@ -13236,7 +13307,7 @@ struct Fts5ExtensionApi {
|
|
|
13236
13307
|
** argument passed to this function is a pointer to an Fts5Tokenizer object
|
|
13237
13308
|
** returned by an earlier call to xCreate().
|
|
13238
13309
|
**
|
|
13239
|
-
** The
|
|
13310
|
+
** The third argument indicates the reason that FTS5 is requesting
|
|
13240
13311
|
** tokenization of the supplied text. This is always one of the following
|
|
13241
13312
|
** four values:
|
|
13242
13313
|
**
|
|
@@ -13260,6 +13331,13 @@ struct Fts5ExtensionApi {
|
|
|
13260
13331
|
** on a columnsize=0 database.
|
|
13261
13332
|
** </ul>
|
|
13262
13333
|
**
|
|
13334
|
+
** The sixth and seventh arguments passed to xTokenize() - pLocale and
|
|
13335
|
+
** nLocale - are a pointer to a buffer containing the locale to use for
|
|
13336
|
+
** tokenization (e.g. "en_US") and its size in bytes, respectively. The
|
|
13337
|
+
** pLocale buffer is not nul-terminated. pLocale may be passed NULL (in
|
|
13338
|
+
** which case nLocale is always 0) to indicate that the tokenizer should
|
|
13339
|
+
** use its default locale.
|
|
13340
|
+
**
|
|
13263
13341
|
** For each token in the input string, the supplied callback xToken() must
|
|
13264
13342
|
** be invoked. The first argument to it should be a copy of the pointer
|
|
13265
13343
|
** passed as the second argument to xTokenize(). The third and fourth
|
|
@@ -13283,6 +13361,30 @@ struct Fts5ExtensionApi {
|
|
|
13283
13361
|
** may abandon the tokenization and return any error code other than
|
|
13284
13362
|
** SQLITE_OK or SQLITE_DONE.
|
|
13285
13363
|
**
|
|
13364
|
+
** If the tokenizer is registered using an fts5_tokenizer_v2 object,
|
|
13365
|
+
** then the xTokenize() method has two additional arguments - pLocale
|
|
13366
|
+
** and nLocale. These specify the locale that the tokenizer should use
|
|
13367
|
+
** for the current request. If pLocale and nLocale are both 0, then the
|
|
13368
|
+
** tokenizer should use its default locale. Otherwise, pLocale points to
|
|
13369
|
+
** an nLocale byte buffer containing the name of the locale to use as utf-8
|
|
13370
|
+
** text. pLocale is not nul-terminated.
|
|
13371
|
+
**
|
|
13372
|
+
** FTS5_TOKENIZER
|
|
13373
|
+
**
|
|
13374
|
+
** There is also an fts5_tokenizer object. This is an older, deprecated,
|
|
13375
|
+
** version of fts5_tokenizer_v2. It is similar except that:
|
|
13376
|
+
**
|
|
13377
|
+
** <ul>
|
|
13378
|
+
** <li> There is no "iVersion" field, and
|
|
13379
|
+
** <li> The xTokenize() method does not take a locale argument.
|
|
13380
|
+
** </ul>
|
|
13381
|
+
**
|
|
13382
|
+
** Legacy fts5_tokenizer tokenizers must be registered using the
|
|
13383
|
+
** legacy xCreateTokenizer() function, instead of xCreateTokenizer_v2().
|
|
13384
|
+
**
|
|
13385
|
+
** Tokenizer implementations registered using either API may be retrieved
|
|
13386
|
+
** using both xFindTokenizer() and xFindTokenizer_v2().
|
|
13387
|
+
**
|
|
13286
13388
|
** SYNONYM SUPPORT
|
|
13287
13389
|
**
|
|
13288
13390
|
** Custom tokenizers may also support synonyms. Consider a case in which a
|
|
@@ -13391,6 +13493,33 @@ struct Fts5ExtensionApi {
|
|
|
13391
13493
|
** inefficient.
|
|
13392
13494
|
*/
|
|
13393
13495
|
typedef struct Fts5Tokenizer Fts5Tokenizer;
|
|
13496
|
+
typedef struct fts5_tokenizer_v2 fts5_tokenizer_v2;
|
|
13497
|
+
struct fts5_tokenizer_v2 {
|
|
13498
|
+
int iVersion; /* Currently always 2 */
|
|
13499
|
+
|
|
13500
|
+
int (*xCreate)(void*, const char **azArg, int nArg, Fts5Tokenizer **ppOut);
|
|
13501
|
+
void (*xDelete)(Fts5Tokenizer*);
|
|
13502
|
+
int (*xTokenize)(Fts5Tokenizer*,
|
|
13503
|
+
void *pCtx,
|
|
13504
|
+
int flags, /* Mask of FTS5_TOKENIZE_* flags */
|
|
13505
|
+
const char *pText, int nText,
|
|
13506
|
+
const char *pLocale, int nLocale,
|
|
13507
|
+
int (*xToken)(
|
|
13508
|
+
void *pCtx, /* Copy of 2nd argument to xTokenize() */
|
|
13509
|
+
int tflags, /* Mask of FTS5_TOKEN_* flags */
|
|
13510
|
+
const char *pToken, /* Pointer to buffer containing token */
|
|
13511
|
+
int nToken, /* Size of token in bytes */
|
|
13512
|
+
int iStart, /* Byte offset of token within input text */
|
|
13513
|
+
int iEnd /* Byte offset of end of token within input text */
|
|
13514
|
+
)
|
|
13515
|
+
);
|
|
13516
|
+
};
|
|
13517
|
+
|
|
13518
|
+
/*
|
|
13519
|
+
** New code should use the fts5_tokenizer_v2 type to define tokenizer
|
|
13520
|
+
** implementations. The following type is included for legacy applications
|
|
13521
|
+
** that still use it.
|
|
13522
|
+
*/
|
|
13394
13523
|
typedef struct fts5_tokenizer fts5_tokenizer;
|
|
13395
13524
|
struct fts5_tokenizer {
|
|
13396
13525
|
int (*xCreate)(void*, const char **azArg, int nArg, Fts5Tokenizer **ppOut);
|
|
@@ -13410,6 +13539,7 @@ struct fts5_tokenizer {
|
|
|
13410
13539
|
);
|
|
13411
13540
|
};
|
|
13412
13541
|
|
|
13542
|
+
|
|
13413
13543
|
/* Flags that may be passed as the third argument to xTokenize() */
|
|
13414
13544
|
#define FTS5_TOKENIZE_QUERY 0x0001
|
|
13415
13545
|
#define FTS5_TOKENIZE_PREFIX 0x0002
|
|
@@ -13429,7 +13559,7 @@ struct fts5_tokenizer {
|
|
|
13429
13559
|
*/
|
|
13430
13560
|
typedef struct fts5_api fts5_api;
|
|
13431
13561
|
struct fts5_api {
|
|
13432
|
-
int iVersion; /* Currently always set to
|
|
13562
|
+
int iVersion; /* Currently always set to 3 */
|
|
13433
13563
|
|
|
13434
13564
|
/* Create a new tokenizer */
|
|
13435
13565
|
int (*xCreateTokenizer)(
|
|
@@ -13456,6 +13586,25 @@ struct fts5_api {
|
|
|
13456
13586
|
fts5_extension_function xFunction,
|
|
13457
13587
|
void (*xDestroy)(void*)
|
|
13458
13588
|
);
|
|
13589
|
+
|
|
13590
|
+
/* APIs below this point are only available if iVersion>=3 */
|
|
13591
|
+
|
|
13592
|
+
/* Create a new tokenizer */
|
|
13593
|
+
int (*xCreateTokenizer_v2)(
|
|
13594
|
+
fts5_api *pApi,
|
|
13595
|
+
const char *zName,
|
|
13596
|
+
void *pUserData,
|
|
13597
|
+
fts5_tokenizer_v2 *pTokenizer,
|
|
13598
|
+
void (*xDestroy)(void*)
|
|
13599
|
+
);
|
|
13600
|
+
|
|
13601
|
+
/* Find an existing tokenizer */
|
|
13602
|
+
int (*xFindTokenizer_v2)(
|
|
13603
|
+
fts5_api *pApi,
|
|
13604
|
+
const char *zName,
|
|
13605
|
+
void **ppUserData,
|
|
13606
|
+
fts5_tokenizer_v2 **ppTokenizer
|
|
13607
|
+
);
|
|
13459
13608
|
};
|
|
13460
13609
|
|
|
13461
13610
|
/*
|
|
@@ -13684,7 +13833,7 @@ SQLITE_API unsigned char* wxsqlite3_codec_data(sqlite3* db, const char* zDbName,
|
|
|
13684
13833
|
*/
|
|
13685
13834
|
typedef struct _CipherParams
|
|
13686
13835
|
{
|
|
13687
|
-
char* m_name;
|
|
13836
|
+
const char* m_name;
|
|
13688
13837
|
int m_value;
|
|
13689
13838
|
int m_default;
|
|
13690
13839
|
int m_minValue;
|
|
@@ -13717,13 +13866,13 @@ typedef int (*GetLegacy_t)(void* cipher);
|
|
|
13717
13866
|
typedef int (*GetPageSize_t)(void* cipher);
|
|
13718
13867
|
typedef int (*GetReserved_t)(void* cipher);
|
|
13719
13868
|
typedef unsigned char* (*GetSalt_t)(void* cipher);
|
|
13720
|
-
typedef void (*GenerateKey_t)(void* cipher,
|
|
13869
|
+
typedef void (*GenerateKey_t)(void* cipher, char* userPassword, int passwordLength, int rekey, unsigned char* cipherSalt);
|
|
13721
13870
|
typedef int (*EncryptPage_t)(void* cipher, int page, unsigned char* data, int len, int reserved);
|
|
13722
13871
|
typedef int (*DecryptPage_t)(void* cipher, int page, unsigned char* data, int len, int reserved, int hmacCheck);
|
|
13723
13872
|
|
|
13724
13873
|
typedef struct _CipherDescriptor
|
|
13725
13874
|
{
|
|
13726
|
-
char*
|
|
13875
|
+
const char* m_name;
|
|
13727
13876
|
AllocateCipher_t m_allocateCipher;
|
|
13728
13877
|
FreeCipher_t m_freeCipher;
|
|
13729
13878
|
CloneCipher_t m_cloneCipher;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "better-sqlite3-multiple-ciphers",
|
|
3
|
-
"version": "11.
|
|
3
|
+
"version": "11.5.0",
|
|
4
4
|
"description": "better-sqlite3 with multiple-cipher encryption support",
|
|
5
5
|
"homepage": "https://github.com/m4heshd/better-sqlite3-multiple-ciphers",
|
|
6
6
|
"author": "Mahesh Bandara Wijerathna (m4heshd) <m4heshd@gmail.com>",
|