better-sqlite3-multiple-ciphers 7.5.0 → 7.5.1-beta.2

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.
@@ -31,9 +31,9 @@
31
31
 
32
32
  #define SQLITE3MC_VERSION_MAJOR 1
33
33
  #define SQLITE3MC_VERSION_MINOR 3
34
- #define SQLITE3MC_VERSION_RELEASE 7
34
+ #define SQLITE3MC_VERSION_RELEASE 8
35
35
  #define SQLITE3MC_VERSION_SUBRELEASE 0
36
- #define SQLITE3MC_VERSION_STRING "SQLite3 Multiple Ciphers 1.3.7"
36
+ #define SQLITE3MC_VERSION_STRING "SQLite3 Multiple Ciphers 1.3.8"
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.37.2"
196
- #define SQLITE_VERSION_NUMBER 3037002
197
- #define SQLITE_SOURCE_ID "2022-01-06 13:25:41 872ba256cbf61d9290b571c0e6d82a20c224ca3ad82971edc46b29818d5d17a0"
195
+ #define SQLITE_VERSION "3.38.0"
196
+ #define SQLITE_VERSION_NUMBER 3038000
197
+ #define SQLITE_SOURCE_ID "2022-02-22 18:58:40 40fa792d359f84c3b9e9d6623743e1a59826274e221df1bde8f47086968a1bab"
198
198
 
199
199
  /*
200
200
  ** CAPI3REF: Run-Time Library Version Numbers
@@ -612,7 +612,7 @@ SQLITE_API int sqlite3_exec(
612
612
  #define SQLITE_WARNING_AUTOINDEX (SQLITE_WARNING | (1<<8))
613
613
  #define SQLITE_AUTH_USER (SQLITE_AUTH | (1<<8))
614
614
  #define SQLITE_OK_LOAD_PERMANENTLY (SQLITE_OK | (1<<8))
615
- #define SQLITE_OK_SYMLINK (SQLITE_OK | (2<<8))
615
+ #define SQLITE_OK_SYMLINK (SQLITE_OK | (2<<8)) /* internal use only */
616
616
 
617
617
  /*
618
618
  ** CAPI3REF: Flags For File Open Operations
@@ -3870,13 +3870,14 @@ SQLITE_API void sqlite3_free_filename(char*);
3870
3870
  ** sqlite3_extended_errcode() might change with each API call.
3871
3871
  ** Except, there are some interfaces that are guaranteed to never
3872
3872
  ** change the value of the error code. The error-code preserving
3873
- ** interfaces are:
3873
+ ** interfaces include the following:
3874
3874
  **
3875
3875
  ** <ul>
3876
3876
  ** <li> sqlite3_errcode()
3877
3877
  ** <li> sqlite3_extended_errcode()
3878
3878
  ** <li> sqlite3_errmsg()
3879
3879
  ** <li> sqlite3_errmsg16()
3880
+ ** <li> sqlite3_error_offset()
3880
3881
  ** </ul>
3881
3882
  **
3882
3883
  ** ^The sqlite3_errmsg() and sqlite3_errmsg16() return English-language
@@ -3891,6 +3892,13 @@ SQLITE_API void sqlite3_free_filename(char*);
3891
3892
  ** ^(Memory to hold the error message string is managed internally
3892
3893
  ** and must not be freed by the application)^.
3893
3894
  **
3895
+ ** ^If the most recent error references a specific token in the input
3896
+ ** SQL, the sqlite3_error_offset() interface returns the byte offset
3897
+ ** of the start of that token. ^The byte offset returned by
3898
+ ** sqlite3_error_offset() assumes that the input SQL is UTF8.
3899
+ ** ^If the most recent error does not reference a specific token in the input
3900
+ ** SQL, then the sqlite3_error_offset() function returns -1.
3901
+ **
3894
3902
  ** When the serialized [threading mode] is in use, it might be the
3895
3903
  ** case that a second error occurs on a separate thread in between
3896
3904
  ** the time of the first error and the call to these interfaces.
@@ -3910,6 +3918,7 @@ SQLITE_API int sqlite3_extended_errcode(sqlite3 *db);
3910
3918
  SQLITE_API const char *sqlite3_errmsg(sqlite3*);
3911
3919
  SQLITE_API const void *sqlite3_errmsg16(sqlite3*);
3912
3920
  SQLITE_API const char *sqlite3_errstr(int);
3921
+ SQLITE_API int sqlite3_error_offset(sqlite3 *db);
3913
3922
 
3914
3923
  /*
3915
3924
  ** CAPI3REF: Prepared Statement Object
@@ -4321,6 +4330,10 @@ SQLITE_API const char *sqlite3_normalized_sql(sqlite3_stmt *pStmt);
4321
4330
  ** be false. ^Similarly, a CREATE TABLE IF NOT EXISTS statement is a
4322
4331
  ** read-only no-op if the table already exists, but
4323
4332
  ** sqlite3_stmt_readonly() still returns false for such a statement.
4333
+ **
4334
+ ** ^If prepared statement X is an [EXPLAIN] or [EXPLAIN QUERY PLAN]
4335
+ ** statement, then sqlite3_stmt_readonly(X) returns the same value as
4336
+ ** if the EXPLAIN or EXPLAIN QUERY PLAN prefix were omitted.
4324
4337
  */
4325
4338
  SQLITE_API int sqlite3_stmt_readonly(sqlite3_stmt *pStmt);
4326
4339
 
@@ -4389,6 +4402,8 @@ SQLITE_API int sqlite3_stmt_busy(sqlite3_stmt*);
4389
4402
  **
4390
4403
  ** ^The sqlite3_value objects that are passed as parameters into the
4391
4404
  ** implementation of [application-defined SQL functions] are protected.
4405
+ ** ^The sqlite3_value objects returned by [sqlite3_vtab_rhs_value()]
4406
+ ** are protected.
4392
4407
  ** ^The sqlite3_value object returned by
4393
4408
  ** [sqlite3_column_value()] is unprotected.
4394
4409
  ** Unprotected sqlite3_value objects may only be used as arguments
@@ -7168,24 +7183,56 @@ struct sqlite3_index_info {
7168
7183
  **
7169
7184
  ** These macros define the allowed values for the
7170
7185
  ** [sqlite3_index_info].aConstraint[].op field. Each value represents
7171
- ** an operator that is part of a constraint term in the wHERE clause of
7186
+ ** an operator that is part of a constraint term in the WHERE clause of
7172
7187
  ** a query that uses a [virtual table].
7173
- */
7174
- #define SQLITE_INDEX_CONSTRAINT_EQ 2
7175
- #define SQLITE_INDEX_CONSTRAINT_GT 4
7176
- #define SQLITE_INDEX_CONSTRAINT_LE 8
7177
- #define SQLITE_INDEX_CONSTRAINT_LT 16
7178
- #define SQLITE_INDEX_CONSTRAINT_GE 32
7179
- #define SQLITE_INDEX_CONSTRAINT_MATCH 64
7180
- #define SQLITE_INDEX_CONSTRAINT_LIKE 65
7181
- #define SQLITE_INDEX_CONSTRAINT_GLOB 66
7182
- #define SQLITE_INDEX_CONSTRAINT_REGEXP 67
7183
- #define SQLITE_INDEX_CONSTRAINT_NE 68
7184
- #define SQLITE_INDEX_CONSTRAINT_ISNOT 69
7185
- #define SQLITE_INDEX_CONSTRAINT_ISNOTNULL 70
7186
- #define SQLITE_INDEX_CONSTRAINT_ISNULL 71
7187
- #define SQLITE_INDEX_CONSTRAINT_IS 72
7188
- #define SQLITE_INDEX_CONSTRAINT_FUNCTION 150
7188
+ **
7189
+ ** ^The left-hand operand of the operator is given by the corresponding
7190
+ ** aConstraint[].iColumn field. ^An iColumn of -1 indicates the left-hand
7191
+ ** operand is the rowid.
7192
+ ** The SQLITE_INDEX_CONSTRAINT_LIMIT and SQLITE_INDEX_CONSTRAINT_OFFSET
7193
+ ** operators have no left-hand operand, and so for those operators the
7194
+ ** corresponding aConstraint[].iColumn is meaningless and should not be
7195
+ ** used.
7196
+ **
7197
+ ** All operator values from SQLITE_INDEX_CONSTRAINT_FUNCTION through
7198
+ ** value 255 are reserved to represent functions that are overloaded
7199
+ ** by the [xFindFunction|xFindFunction method] of the virtual table
7200
+ ** implementation.
7201
+ **
7202
+ ** The right-hand operands for each constraint might be accessible using
7203
+ ** the [sqlite3_vtab_rhs_value()] interface. Usually the right-hand
7204
+ ** operand is only available if it appears as a single constant literal
7205
+ ** in the input SQL. If the right-hand operand is another column or an
7206
+ ** expression (even a constant expression) or a parameter, then the
7207
+ ** sqlite3_vtab_rhs_value() probably will not be able to extract it.
7208
+ ** ^The SQLITE_INDEX_CONSTRAINT_ISNULL and
7209
+ ** SQLITE_INDEX_CONSTRAINT_ISNOTNULL operators have no right-hand operand
7210
+ ** and hence calls to sqlite3_vtab_rhs_value() for those operators will
7211
+ ** always return SQLITE_NOTFOUND.
7212
+ **
7213
+ ** The collating sequence to be used for comparison can be found using
7214
+ ** the [sqlite3_vtab_collation()] interface. For most real-world virtual
7215
+ ** tables, the collating sequence of constraints does not matter (for example
7216
+ ** because the constraints are numeric) and so the sqlite3_vtab_collation()
7217
+ ** interface is no commonly needed.
7218
+ */
7219
+ #define SQLITE_INDEX_CONSTRAINT_EQ 2
7220
+ #define SQLITE_INDEX_CONSTRAINT_GT 4
7221
+ #define SQLITE_INDEX_CONSTRAINT_LE 8
7222
+ #define SQLITE_INDEX_CONSTRAINT_LT 16
7223
+ #define SQLITE_INDEX_CONSTRAINT_GE 32
7224
+ #define SQLITE_INDEX_CONSTRAINT_MATCH 64
7225
+ #define SQLITE_INDEX_CONSTRAINT_LIKE 65
7226
+ #define SQLITE_INDEX_CONSTRAINT_GLOB 66
7227
+ #define SQLITE_INDEX_CONSTRAINT_REGEXP 67
7228
+ #define SQLITE_INDEX_CONSTRAINT_NE 68
7229
+ #define SQLITE_INDEX_CONSTRAINT_ISNOT 69
7230
+ #define SQLITE_INDEX_CONSTRAINT_ISNOTNULL 70
7231
+ #define SQLITE_INDEX_CONSTRAINT_ISNULL 71
7232
+ #define SQLITE_INDEX_CONSTRAINT_IS 72
7233
+ #define SQLITE_INDEX_CONSTRAINT_LIMIT 73
7234
+ #define SQLITE_INDEX_CONSTRAINT_OFFSET 74
7235
+ #define SQLITE_INDEX_CONSTRAINT_FUNCTION 150
7189
7236
 
7190
7237
  /*
7191
7238
  ** CAPI3REF: Register A Virtual Table Implementation
@@ -7214,7 +7261,7 @@ struct sqlite3_index_info {
7214
7261
  ** destructor.
7215
7262
  **
7216
7263
  ** ^If the third parameter (the pointer to the sqlite3_module object) is
7217
- ** NULL then no new module is create and any existing modules with the
7264
+ ** NULL then no new module is created and any existing modules with the
7218
7265
  ** same name are dropped.
7219
7266
  **
7220
7267
  ** See also: [sqlite3_drop_modules()]
@@ -7990,7 +8037,8 @@ SQLITE_API int sqlite3_test_control(int op, ...);
7990
8037
  #define SQLITE_TESTCTRL_SEEK_COUNT 30
7991
8038
  #define SQLITE_TESTCTRL_TRACEFLAGS 31
7992
8039
  #define SQLITE_TESTCTRL_TUNE 32
7993
- #define SQLITE_TESTCTRL_LAST 32 /* Largest TESTCTRL */
8040
+ #define SQLITE_TESTCTRL_LOGEST 33
8041
+ #define SQLITE_TESTCTRL_LAST 33 /* Largest TESTCTRL */
7994
8042
 
7995
8043
  /*
7996
8044
  ** CAPI3REF: SQL Keyword Checking
@@ -8513,6 +8561,16 @@ SQLITE_API int sqlite3_stmt_status(sqlite3_stmt*, int op,int resetFlg);
8513
8561
  ** The counter is incremented on the first [sqlite3_step()] call of each
8514
8562
  ** cycle.
8515
8563
  **
8564
+ ** [[SQLITE_STMTSTATUS_FILTER_MISS]]
8565
+ ** [[SQLITE_STMTSTATUS_FILTER HIT]]
8566
+ ** <dt>SQLITE_STMTSTATUS_FILTER_HIT<br>
8567
+ ** SQLITE_STMTSTATUS_FILTER_MISS</dt>
8568
+ ** <dd>^SQLITE_STMTSTATUS_FILTER_HIT is the number of times that a join
8569
+ ** step was bypassed because a Bloom filter returned not-found. The
8570
+ ** corresponding SQLITE_STMTSTATUS_FILTER_MISS value is the number of
8571
+ ** times that the Bloom filter returned a find, and thus the join step
8572
+ ** had to be processed as normal.
8573
+ **
8516
8574
  ** [[SQLITE_STMTSTATUS_MEMUSED]] <dt>SQLITE_STMTSTATUS_MEMUSED</dt>
8517
8575
  ** <dd>^This is the approximate number of bytes of heap memory
8518
8576
  ** used to store the prepared statement. ^This value is not actually
@@ -8527,6 +8585,8 @@ SQLITE_API int sqlite3_stmt_status(sqlite3_stmt*, int op,int resetFlg);
8527
8585
  #define SQLITE_STMTSTATUS_VM_STEP 4
8528
8586
  #define SQLITE_STMTSTATUS_REPREPARE 5
8529
8587
  #define SQLITE_STMTSTATUS_RUN 6
8588
+ #define SQLITE_STMTSTATUS_FILTER_MISS 7
8589
+ #define SQLITE_STMTSTATUS_FILTER_HIT 8
8530
8590
  #define SQLITE_STMTSTATUS_MEMUSED 99
8531
8591
 
8532
8592
  /*
@@ -9495,19 +9555,269 @@ SQLITE_API int sqlite3_vtab_nochange(sqlite3_context*);
9495
9555
 
9496
9556
  /*
9497
9557
  ** CAPI3REF: Determine The Collation For a Virtual Table Constraint
9558
+ ** METHOD: sqlite3_index_info
9498
9559
  **
9499
9560
  ** This function may only be called from within a call to the [xBestIndex]
9500
- ** method of a [virtual table].
9561
+ ** method of a [virtual table]. This function returns a pointer to a string
9562
+ ** that is the name of the appropriate collation sequence to use for text
9563
+ ** comparisons on the constraint identified by its arguments.
9501
9564
  **
9502
- ** The first argument must be the sqlite3_index_info object that is the
9503
- ** first parameter to the xBestIndex() method. The second argument must be
9504
- ** an index into the aConstraint[] array belonging to the sqlite3_index_info
9505
- ** structure passed to xBestIndex. This function returns a pointer to a buffer
9506
- ** containing the name of the collation sequence for the corresponding
9507
- ** constraint.
9565
+ ** The first argument must be the pointer to the [sqlite3_index_info] object
9566
+ ** that is the first parameter to the xBestIndex() method. The second argument
9567
+ ** must be an index into the aConstraint[] array belonging to the
9568
+ ** sqlite3_index_info structure passed to xBestIndex.
9569
+ **
9570
+ ** Important:
9571
+ ** The first parameter must be the same pointer that is passed into the
9572
+ ** xBestMethod() method. The first parameter may not be a pointer to a
9573
+ ** different [sqlite3_index_info] object, even an exact copy.
9574
+ **
9575
+ ** The return value is computed as follows:
9576
+ **
9577
+ ** <ol>
9578
+ ** <li><p> If the constraint comes from a WHERE clause expression that contains
9579
+ ** a [COLLATE operator], then the name of the collation specified by
9580
+ ** that COLLATE operator is returned.
9581
+ ** <li><p> If there is no COLLATE operator, but the column that is the subject
9582
+ ** of the constraint specifies an alternative collating sequence via
9583
+ ** a [COLLATE clause] on the column definition within the CREATE TABLE
9584
+ ** statement that was passed into [sqlite3_declare_vtab()], then the
9585
+ ** name of that alternative collating sequence is returned.
9586
+ ** <li><p> Otherwise, "BINARY" is returned.
9587
+ ** </ol>
9508
9588
  */
9509
9589
  SQLITE_API SQLITE_EXPERIMENTAL const char *sqlite3_vtab_collation(sqlite3_index_info*,int);
9510
9590
 
9591
+ /*
9592
+ ** CAPI3REF: Determine if a virtual table query is DISTINCT
9593
+ ** METHOD: sqlite3_index_info
9594
+ **
9595
+ ** This API may only be used from within an [xBestIndex|xBestIndex method]
9596
+ ** of a [virtual table] implementation. The result of calling this
9597
+ ** interface from outside of xBestIndex() is undefined and probably harmful.
9598
+ **
9599
+ ** ^The sqlite3_vtab_distinct() interface returns an integer that is
9600
+ ** either 0, 1, or 2. The integer returned by sqlite3_vtab_distinct()
9601
+ ** gives the virtual table additional information about how the query
9602
+ ** planner wants the output to be ordered. As long as the virtual table
9603
+ ** can meet the ordering requirements of the query planner, it may set
9604
+ ** the "orderByConsumed" flag.
9605
+ **
9606
+ ** <ol><li value="0"><p>
9607
+ ** ^If the sqlite3_vtab_distinct() interface returns 0, that means
9608
+ ** that the query planner needs the virtual table to return all rows in the
9609
+ ** sort order defined by the "nOrderBy" and "aOrderBy" fields of the
9610
+ ** [sqlite3_index_info] object. This is the default expectation. If the
9611
+ ** virtual table outputs all rows in sorted order, then it is always safe for
9612
+ ** the xBestIndex method to set the "orderByConsumed" flag, regardless of
9613
+ ** the return value from sqlite3_vtab_distinct().
9614
+ ** <li value="1"><p>
9615
+ ** ^(If the sqlite3_vtab_distinct() interface returns 1, that means
9616
+ ** that the query planner does not need the rows to be returned in sorted order
9617
+ ** as long as all rows with the same values in all columns identified by the
9618
+ ** "aOrderBy" field are adjacent.)^ This mode is used when the query planner
9619
+ ** is doing a GROUP BY.
9620
+ ** <li value="2"><p>
9621
+ ** ^(If the sqlite3_vtab_distinct() interface returns 2, that means
9622
+ ** that the query planner does not need the rows returned in any particular
9623
+ ** order, as long as rows with the same values in all "aOrderBy" columns
9624
+ ** are adjacent.)^ ^(Furthermore, only a single row for each particular
9625
+ ** combination of values in the columns identified by the "aOrderBy" field
9626
+ ** needs to be returned.)^ ^It is always ok for two or more rows with the same
9627
+ ** values in all "aOrderBy" columns to be returned, as long as all such rows
9628
+ ** are adjacent. ^The virtual table may, if it chooses, omit extra rows
9629
+ ** that have the same value for all columns identified by "aOrderBy".
9630
+ ** ^However omitting the extra rows is optional.
9631
+ ** This mode is used for a DISTINCT query.
9632
+ ** </ol>
9633
+ **
9634
+ ** ^For the purposes of comparing virtual table output values to see if the
9635
+ ** values are same value for sorting purposes, two NULL values are considered
9636
+ ** to be the same. In other words, the comparison operator is "IS"
9637
+ ** (or "IS NOT DISTINCT FROM") and not "==".
9638
+ **
9639
+ ** If a virtual table implementation is unable to meet the requirements
9640
+ ** specified above, then it must not set the "orderByConsumed" flag in the
9641
+ ** [sqlite3_index_info] object or an incorrect answer may result.
9642
+ **
9643
+ ** ^A virtual table implementation is always free to return rows in any order
9644
+ ** it wants, as long as the "orderByConsumed" flag is not set. ^When the
9645
+ ** the "orderByConsumed" flag is unset, the query planner will add extra
9646
+ ** [bytecode] to ensure that the final results returned by the SQL query are
9647
+ ** ordered correctly. The use of the "orderByConsumed" flag and the
9648
+ ** sqlite3_vtab_distinct() interface is merely an optimization. ^Careful
9649
+ ** use of the sqlite3_vtab_distinct() interface and the "orderByConsumed"
9650
+ ** flag might help queries against a virtual table to run faster. Being
9651
+ ** overly aggressive and setting the "orderByConsumed" flag when it is not
9652
+ ** valid to do so, on the other hand, might cause SQLite to return incorrect
9653
+ ** results.
9654
+ */
9655
+ SQLITE_API int sqlite3_vtab_distinct(sqlite3_index_info*);
9656
+
9657
+ /*
9658
+ ** CAPI3REF: Identify and handle IN constraints in xBestIndex
9659
+ **
9660
+ ** This interface may only be used from within an
9661
+ ** [xBestIndex|xBestIndex() method] of a [virtual table] implementation.
9662
+ ** The result of invoking this interface from any other context is
9663
+ ** undefined and probably harmful.
9664
+ **
9665
+ ** ^(A constraint on a virtual table of the form
9666
+ ** "[IN operator|column IN (...)]" is
9667
+ ** communicated to the xBestIndex method as a
9668
+ ** [SQLITE_INDEX_CONSTRAINT_EQ] constraint.)^ If xBestIndex wants to use
9669
+ ** this constraint, it must set the corresponding
9670
+ ** aConstraintUsage[].argvIndex to a postive integer. ^(Then, under
9671
+ ** the usual mode of handling IN operators, SQLite generates [bytecode]
9672
+ ** that invokes the [xFilter|xFilter() method] once for each value
9673
+ ** on the right-hand side of the IN operator.)^ Thus the virtual table
9674
+ ** only sees a single value from the right-hand side of the IN operator
9675
+ ** at a time.
9676
+ **
9677
+ ** In some cases, however, it would be advantageous for the virtual
9678
+ ** table to see all values on the right-hand of the IN operator all at
9679
+ ** once. The sqlite3_vtab_in() interfaces facilitates this in two ways:
9680
+ **
9681
+ ** <ol>
9682
+ ** <li><p>
9683
+ ** ^A call to sqlite3_vtab_in(P,N,-1) will return true (non-zero)
9684
+ ** if and only if the [sqlite3_index_info|P->aConstraint][N] constraint
9685
+ ** is an [IN operator] that can be processed all at once. ^In other words,
9686
+ ** sqlite3_vtab_in() with -1 in the third argument is a mechanism
9687
+ ** by which the virtual table can ask SQLite if all-at-once processing
9688
+ ** of the IN operator is even possible.
9689
+ **
9690
+ ** <li><p>
9691
+ ** ^A call to sqlite3_vtab_in(P,N,F) with F==1 or F==0 indicates
9692
+ ** to SQLite that the virtual table does or does not want to process
9693
+ ** the IN operator all-at-once, respectively. ^Thus when the third
9694
+ ** parameter (F) is non-negative, this interface is the mechanism by
9695
+ ** which the virtual table tells SQLite how it wants to process the
9696
+ ** IN operator.
9697
+ ** </ol>
9698
+ **
9699
+ ** ^The sqlite3_vtab_in(P,N,F) interface can be invoked multiple times
9700
+ ** within the same xBestIndex method call. ^For any given P,N pair,
9701
+ ** the return value from sqlite3_vtab_in(P,N,F) will always be the same
9702
+ ** within the same xBestIndex call. ^If the interface returns true
9703
+ ** (non-zero), that means that the constraint is an IN operator
9704
+ ** that can be processed all-at-once. ^If the constraint is not an IN
9705
+ ** operator or cannot be processed all-at-once, then the interface returns
9706
+ ** false.
9707
+ **
9708
+ ** ^(All-at-once processing of the IN operator is selected if both of the
9709
+ ** following conditions are met:
9710
+ **
9711
+ ** <ol>
9712
+ ** <li><p> The P->aConstraintUsage[N].argvIndex value is set to a positive
9713
+ ** integer. This is how the virtual table tells SQLite that it wants to
9714
+ ** use the N-th constraint.
9715
+ **
9716
+ ** <li><p> The last call to sqlite3_vtab_in(P,N,F) for which F was
9717
+ ** non-negative had F>=1.
9718
+ ** </ol>)^
9719
+ **
9720
+ ** ^If either or both of the conditions above are false, then SQLite uses
9721
+ ** the traditional one-at-a-time processing strategy for the IN constraint.
9722
+ ** ^If both conditions are true, then the argvIndex-th parameter to the
9723
+ ** xFilter method will be an [sqlite3_value] that appears to be NULL,
9724
+ ** but which can be passed to [sqlite3_vtab_in_first()] and
9725
+ ** [sqlite3_vtab_in_next()] to find all values on the right-hand side
9726
+ ** of the IN constraint.
9727
+ */
9728
+ SQLITE_API int sqlite3_vtab_in(sqlite3_index_info*, int iCons, int bHandle);
9729
+
9730
+ /*
9731
+ ** CAPI3REF: Find all elements on the right-hand side of an IN constraint.
9732
+ **
9733
+ ** These interfaces are only useful from within the
9734
+ ** [xFilter|xFilter() method] of a [virtual table] implementation.
9735
+ ** The result of invoking these interfaces from any other context
9736
+ ** is undefined and probably harmful.
9737
+ **
9738
+ ** The X parameter in a call to sqlite3_vtab_in_first(X,P) or
9739
+ ** sqlite3_vtab_in_next(X,P) must be one of the parameters to the
9740
+ ** xFilter method which invokes these routines, and specifically
9741
+ ** a parameter that was previously selected for all-at-once IN constraint
9742
+ ** processing use the [sqlite3_vtab_in()] interface in the
9743
+ ** [xBestIndex|xBestIndex method]. ^(If the X parameter is not
9744
+ ** an xFilter argument that was selected for all-at-once IN constraint
9745
+ ** processing, then these routines return [SQLITE_MISUSE])^ or perhaps
9746
+ ** exhibit some other undefined or harmful behavior.
9747
+ **
9748
+ ** ^(Use these routines to access all values on the right-hand side
9749
+ ** of the IN constraint using code like the following:
9750
+ **
9751
+ ** <blockquote><pre>
9752
+ ** &nbsp; for(rc=sqlite3_vtab_in_first(pList, &pVal);
9753
+ ** &nbsp; rc==SQLITE_OK && pVal
9754
+ ** &nbsp; rc=sqlite3_vtab_in_next(pList, &pVal)
9755
+ ** &nbsp; ){
9756
+ ** &nbsp; // do something with pVal
9757
+ ** &nbsp; }
9758
+ ** &nbsp; if( rc!=SQLITE_OK ){
9759
+ ** &nbsp; // an error has occurred
9760
+ ** &nbsp; }
9761
+ ** </pre></blockquote>)^
9762
+ **
9763
+ ** ^On success, the sqlite3_vtab_in_first(X,P) and sqlite3_vtab_in_next(X,P)
9764
+ ** routines return SQLITE_OK and set *P to point to the first or next value
9765
+ ** on the RHS of the IN constraint. ^If there are no more values on the
9766
+ ** right hand side of the IN constraint, then *P is set to NULL and these
9767
+ ** routines return [SQLITE_DONE]. ^The return value might be
9768
+ ** some other value, such as SQLITE_NOMEM, in the event of a malfunction.
9769
+ **
9770
+ ** The *ppOut values returned by these routines are only valid until the
9771
+ ** next call to either of these routines or until the end of the xFilter
9772
+ ** method from which these routines were called. If the virtual table
9773
+ ** implementation needs to retain the *ppOut values for longer, it must make
9774
+ ** copies. The *ppOut values are [protected sqlite3_value|protected].
9775
+ */
9776
+ SQLITE_API int sqlite3_vtab_in_first(sqlite3_value *pVal, sqlite3_value **ppOut);
9777
+ SQLITE_API int sqlite3_vtab_in_next(sqlite3_value *pVal, sqlite3_value **ppOut);
9778
+
9779
+ /*
9780
+ ** CAPI3REF: Constraint values in xBestIndex()
9781
+ ** METHOD: sqlite3_index_info
9782
+ **
9783
+ ** This API may only be used from within the [xBestIndex|xBestIndex method]
9784
+ ** of a [virtual table] implementation. The result of calling this interface
9785
+ ** from outside of an xBestIndex method are undefined and probably harmful.
9786
+ **
9787
+ ** ^When the sqlite3_vtab_rhs_value(P,J,V) interface is invoked from within
9788
+ ** the [xBestIndex] method of a [virtual table] implementation, with P being
9789
+ ** a copy of the [sqlite3_index_info] object pointer passed into xBestIndex and
9790
+ ** J being a 0-based index into P->aConstraint[], then this routine
9791
+ ** attempts to set *V to the value of the right-hand operand of
9792
+ ** that constraint if the right-hand operand is known. ^If the
9793
+ ** right-hand operand is not known, then *V is set to a NULL pointer.
9794
+ ** ^The sqlite3_vtab_rhs_value(P,J,V) interface returns SQLITE_OK if
9795
+ ** and only if *V is set to a value. ^The sqlite3_vtab_rhs_value(P,J,V)
9796
+ ** inteface returns SQLITE_NOTFOUND if the right-hand side of the J-th
9797
+ ** constraint is not available. ^The sqlite3_vtab_rhs_value() interface
9798
+ ** can return an result code other than SQLITE_OK or SQLITE_NOTFOUND if
9799
+ ** something goes wrong.
9800
+ **
9801
+ ** The sqlite3_vtab_rhs_value() interface is usually only successful if
9802
+ ** the right-hand operand of a constraint is a literal value in the original
9803
+ ** SQL statement. If the right-hand operand is an expression or a reference
9804
+ ** to some other column or a [host parameter], then sqlite3_vtab_rhs_value()
9805
+ ** will probably return [SQLITE_NOTFOUND].
9806
+ **
9807
+ ** ^(Some constraints, such as [SQLITE_INDEX_CONSTRAINT_ISNULL] and
9808
+ ** [SQLITE_INDEX_CONSTRAINT_ISNOTNULL], have no right-hand operand. For such
9809
+ ** constraints, sqlite3_vtab_rhs_value() always returns SQLITE_NOTFOUND.)^
9810
+ **
9811
+ ** ^The [sqlite3_value] object returned in *V is a protected sqlite3_value
9812
+ ** and remains valid for the duration of the xBestIndex method call.
9813
+ ** ^When xBestIndex returns, the sqlite3_value object returned by
9814
+ ** sqlite3_vtab_rhs_value() is automatically deallocated.
9815
+ **
9816
+ ** The "_rhs_" in the name of this routine is an appreviation for
9817
+ ** "Right-Hand Side".
9818
+ */
9819
+ SQLITE_API int sqlite3_vtab_rhs_value(sqlite3_index_info*, int, sqlite3_value **ppVal);
9820
+
9511
9821
  /*
9512
9822
  ** CAPI3REF: Conflict resolution modes
9513
9823
  ** KEYWORDS: {conflict resolution mode}
@@ -344,6 +344,13 @@ struct sqlite3_api_routines {
344
344
  int (*autovacuum_pages)(sqlite3*,
345
345
  unsigned int(*)(void*,const char*,unsigned int,unsigned int,unsigned int),
346
346
  void*, void(*)(void*));
347
+ /* Version 3.38.0 and later */
348
+ int (*error_offset)(sqlite3*);
349
+ int (*vtab_rhs_value)(sqlite3_index_info*,int,sqlite3_value**);
350
+ int (*vtab_distinct)(sqlite3_index_info*);
351
+ int (*vtab_in)(sqlite3_index_info*,int,int);
352
+ int (*vtab_in_first)(sqlite3_value*,sqlite3_value**);
353
+ int (*vtab_in_next)(sqlite3_value*,sqlite3_value**);
347
354
  };
348
355
 
349
356
  /*
@@ -655,6 +662,13 @@ typedef int (*sqlite3_loadext_entry)(
655
662
  #define sqlite3_total_changes64 sqlite3_api->total_changes64
656
663
  /* Version 3.37.0 and later */
657
664
  #define sqlite3_autovacuum_pages sqlite3_api->autovacuum_pages
665
+ /* Version 3.38.0 and later */
666
+ #define sqlite3_error_offset sqlite3_api->error_offset
667
+ #define sqlite3_vtab_rhs_value sqlite3_api->vtab_rhs_value
668
+ #define sqlite3_vtab_distinct sqlite3_api->vtab_distinct
669
+ #define sqlite3_vtab_in sqlite3_api->vtab_in
670
+ #define sqlite3_vtab_in_first sqlite3_api->vtab_in_first
671
+ #define sqlite3_vtab_in_next sqlite3_api->vtab_in_next
658
672
  #endif /* !defined(SQLITE_CORE) && !defined(SQLITE_OMIT_LOAD_EXTENSION) */
659
673
 
660
674
  #if !defined(SQLITE_CORE) && !defined(SQLITE_OMIT_LOAD_EXTENSION)
package/deps/sqlite3.gyp CHANGED
@@ -73,6 +73,10 @@
73
73
  'cflags!': ['-maes', '-msse4.2'],
74
74
  'cflags': ['-march=native'],
75
75
  }],
76
+ ['target_arch=="arm"', {
77
+ 'cflags!': ['-maes', '-msse4.2'],
78
+ 'cflags': ['-march=native'],
79
+ }],
76
80
  ],
77
81
  'configurations': {
78
82
  'Debug': {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "better-sqlite3-multiple-ciphers",
3
- "version": "7.5.0",
3
+ "version": "7.5.1-beta.2",
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>",
@@ -35,7 +35,7 @@
35
35
  "build-debug": "node-gyp rebuild --debug",
36
36
  "rebuild-release": "npm run lzz && npm run build-release",
37
37
  "rebuild-debug": "npm run lzz && npm run build-debug",
38
- "test": "mocha --exit --slow=75 --timeout=5000",
38
+ "test": "mocha --exit --slow=75 --timeout=30000",
39
39
  "benchmark": "node benchmark",
40
40
  "download": "bash ./deps/download.sh",
41
41
  "setup": "powershell ./deps/setup.ps1",