better-sqlite3-multiple-ciphers 11.8.1 → 11.9.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/sqlite3/sqlite3.c +2471 -1941
- package/deps/sqlite3/sqlite3.h +127 -32
- package/deps/update-sqlite3mc.sh +140 -140
- package/package.json +1 -1
package/deps/sqlite3/sqlite3.h
CHANGED
|
@@ -30,10 +30,10 @@
|
|
|
30
30
|
#define SQLITE3MC_VERSION_H_
|
|
31
31
|
|
|
32
32
|
#define SQLITE3MC_VERSION_MAJOR 2
|
|
33
|
-
#define SQLITE3MC_VERSION_MINOR
|
|
34
|
-
#define SQLITE3MC_VERSION_RELEASE
|
|
33
|
+
#define SQLITE3MC_VERSION_MINOR 1
|
|
34
|
+
#define SQLITE3MC_VERSION_RELEASE 0
|
|
35
35
|
#define SQLITE3MC_VERSION_SUBRELEASE 0
|
|
36
|
-
#define SQLITE3MC_VERSION_STRING "SQLite3 Multiple Ciphers 2.0
|
|
36
|
+
#define SQLITE3MC_VERSION_STRING "SQLite3 Multiple Ciphers 2.1.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 "2025-
|
|
195
|
+
#define SQLITE_VERSION "3.49.1"
|
|
196
|
+
#define SQLITE_VERSION_NUMBER 3049001
|
|
197
|
+
#define SQLITE_SOURCE_ID "2025-02-18 13:38:58 873d4e274b4988d260ba8354a9718324a1c26187a4ab4c1cc0227c03d0f10e70"
|
|
198
198
|
|
|
199
199
|
/*
|
|
200
200
|
** CAPI3REF: Run-Time Library Version Numbers
|
|
@@ -2257,7 +2257,15 @@ struct sqlite3_mem_methods {
|
|
|
2257
2257
|
** CAPI3REF: Database Connection Configuration Options
|
|
2258
2258
|
**
|
|
2259
2259
|
** These constants are the available integer configuration options that
|
|
2260
|
-
** can be passed as the second
|
|
2260
|
+
** can be passed as the second parameter to the [sqlite3_db_config()] interface.
|
|
2261
|
+
**
|
|
2262
|
+
** The [sqlite3_db_config()] interface is a var-args functions. It takes a
|
|
2263
|
+
** variable number of parameters, though always at least two. The number of
|
|
2264
|
+
** parameters passed into sqlite3_db_config() depends on which of these
|
|
2265
|
+
** constants is given as the second parameter. This documentation page
|
|
2266
|
+
** refers to parameters beyond the second as "arguments". Thus, when this
|
|
2267
|
+
** page says "the N-th argument" it means "the N-th parameter past the
|
|
2268
|
+
** configuration option" or "the (N+2)-th parameter to sqlite3_db_config()".
|
|
2261
2269
|
**
|
|
2262
2270
|
** New configuration options may be added in future releases of SQLite.
|
|
2263
2271
|
** Existing configuration options might be discontinued. Applications
|
|
@@ -2269,8 +2277,14 @@ struct sqlite3_mem_methods {
|
|
|
2269
2277
|
** <dl>
|
|
2270
2278
|
** [[SQLITE_DBCONFIG_LOOKASIDE]]
|
|
2271
2279
|
** <dt>SQLITE_DBCONFIG_LOOKASIDE</dt>
|
|
2272
|
-
** <dd>
|
|
2273
|
-
**
|
|
2280
|
+
** <dd> The SQLITE_DBCONFIG_LOOKASIDE option is used to adjust the
|
|
2281
|
+
** configuration of the lookaside memory allocator within a database
|
|
2282
|
+
** connection.
|
|
2283
|
+
** The arguments to the SQLITE_DBCONFIG_LOOKASIDE option are <i>not</i>
|
|
2284
|
+
** in the [DBCONFIG arguments|usual format].
|
|
2285
|
+
** The SQLITE_DBCONFIG_LOOKASIDE option takes three arguments, not two,
|
|
2286
|
+
** so that a call to [sqlite3_db_config()] that uses SQLITE_DBCONFIG_LOOKASIDE
|
|
2287
|
+
** should have a total of five parameters.
|
|
2274
2288
|
** ^The first argument (the third parameter to [sqlite3_db_config()] is a
|
|
2275
2289
|
** pointer to a memory buffer to use for lookaside memory.
|
|
2276
2290
|
** ^The first argument after the SQLITE_DBCONFIG_LOOKASIDE verb
|
|
@@ -2293,7 +2307,8 @@ struct sqlite3_mem_methods {
|
|
|
2293
2307
|
** [[SQLITE_DBCONFIG_ENABLE_FKEY]]
|
|
2294
2308
|
** <dt>SQLITE_DBCONFIG_ENABLE_FKEY</dt>
|
|
2295
2309
|
** <dd> ^This option is used to enable or disable the enforcement of
|
|
2296
|
-
** [foreign key constraints].
|
|
2310
|
+
** [foreign key constraints]. This is the same setting that is
|
|
2311
|
+
** enabled or disabled by the [PRAGMA foreign_keys] statement.
|
|
2297
2312
|
** The first argument is an integer which is 0 to disable FK enforcement,
|
|
2298
2313
|
** positive to enable FK enforcement or negative to leave FK enforcement
|
|
2299
2314
|
** unchanged. The second parameter is a pointer to an integer into which
|
|
@@ -2315,13 +2330,13 @@ struct sqlite3_mem_methods {
|
|
|
2315
2330
|
** <p>Originally this option disabled all triggers. ^(However, since
|
|
2316
2331
|
** SQLite version 3.35.0, TEMP triggers are still allowed even if
|
|
2317
2332
|
** this option is off. So, in other words, this option now only disables
|
|
2318
|
-
** triggers in the main database schema or in the schemas of ATTACH-ed
|
|
2333
|
+
** triggers in the main database schema or in the schemas of [ATTACH]-ed
|
|
2319
2334
|
** databases.)^ </dd>
|
|
2320
2335
|
**
|
|
2321
2336
|
** [[SQLITE_DBCONFIG_ENABLE_VIEW]]
|
|
2322
2337
|
** <dt>SQLITE_DBCONFIG_ENABLE_VIEW</dt>
|
|
2323
2338
|
** <dd> ^This option is used to enable or disable [CREATE VIEW | views].
|
|
2324
|
-
** There
|
|
2339
|
+
** There must be two additional arguments.
|
|
2325
2340
|
** The first argument is an integer which is 0 to disable views,
|
|
2326
2341
|
** positive to enable views or negative to leave the setting unchanged.
|
|
2327
2342
|
** The second parameter is a pointer to an integer into which
|
|
@@ -2340,7 +2355,7 @@ struct sqlite3_mem_methods {
|
|
|
2340
2355
|
** <dd> ^This option is used to enable or disable the
|
|
2341
2356
|
** [fts3_tokenizer()] function which is part of the
|
|
2342
2357
|
** [FTS3] full-text search engine extension.
|
|
2343
|
-
** There
|
|
2358
|
+
** There must be two additional arguments.
|
|
2344
2359
|
** The first argument is an integer which is 0 to disable fts3_tokenizer() or
|
|
2345
2360
|
** positive to enable fts3_tokenizer() or negative to leave the setting
|
|
2346
2361
|
** unchanged.
|
|
@@ -2355,7 +2370,7 @@ struct sqlite3_mem_methods {
|
|
|
2355
2370
|
** interface independently of the [load_extension()] SQL function.
|
|
2356
2371
|
** The [sqlite3_enable_load_extension()] API enables or disables both the
|
|
2357
2372
|
** C-API [sqlite3_load_extension()] and the SQL function [load_extension()].
|
|
2358
|
-
** There
|
|
2373
|
+
** There must be two additional arguments.
|
|
2359
2374
|
** When the first argument to this interface is 1, then only the C-API is
|
|
2360
2375
|
** enabled and the SQL function remains disabled. If the first argument to
|
|
2361
2376
|
** this interface is 0, then both the C-API and the SQL function are disabled.
|
|
@@ -2369,23 +2384,30 @@ struct sqlite3_mem_methods {
|
|
|
2369
2384
|
**
|
|
2370
2385
|
** [[SQLITE_DBCONFIG_MAINDBNAME]] <dt>SQLITE_DBCONFIG_MAINDBNAME</dt>
|
|
2371
2386
|
** <dd> ^This option is used to change the name of the "main" database
|
|
2372
|
-
** schema.
|
|
2373
|
-
**
|
|
2374
|
-
**
|
|
2375
|
-
**
|
|
2376
|
-
**
|
|
2387
|
+
** schema. This option does not follow the
|
|
2388
|
+
** [DBCONFIG arguments|usual SQLITE_DBCONFIG argument format].
|
|
2389
|
+
** This option takes exactly one additional argument so that the
|
|
2390
|
+
** [sqlite3_db_config()] call has a total of three parameters. The
|
|
2391
|
+
** extra argument must be a pointer to a constant UTF8 string which
|
|
2392
|
+
** will become the new schema name in place of "main". ^SQLite does
|
|
2393
|
+
** not make a copy of the new main schema name string, so the application
|
|
2394
|
+
** must ensure that the argument passed into SQLITE_DBCONFIG MAINDBNAME
|
|
2395
|
+
** is unchanged until after the database connection closes.
|
|
2377
2396
|
** </dd>
|
|
2378
2397
|
**
|
|
2379
2398
|
** [[SQLITE_DBCONFIG_NO_CKPT_ON_CLOSE]]
|
|
2380
2399
|
** <dt>SQLITE_DBCONFIG_NO_CKPT_ON_CLOSE</dt>
|
|
2381
|
-
** <dd> Usually, when a database in
|
|
2382
|
-
** database handle, SQLite checks if
|
|
2383
|
-
**
|
|
2384
|
-
**
|
|
2385
|
-
**
|
|
2386
|
-
**
|
|
2387
|
-
**
|
|
2388
|
-
**
|
|
2400
|
+
** <dd> Usually, when a database in [WAL mode] is closed or detached from a
|
|
2401
|
+
** database handle, SQLite checks if if there are other connections to the
|
|
2402
|
+
** same database, and if there are no other database connection (if the
|
|
2403
|
+
** connection being closed is the last open connection to the database),
|
|
2404
|
+
** then SQLite performs a [checkpoint] before closing the connection and
|
|
2405
|
+
** deletes the WAL file. The SQLITE_DBCONFIG_NO_CKPT_ON_CLOSE option can
|
|
2406
|
+
** be used to override that behavior. The first argument passed to this
|
|
2407
|
+
** operation (the third parameter to [sqlite3_db_config()]) is an integer
|
|
2408
|
+
** which is positive to disable checkpoints-on-close, or zero (the default)
|
|
2409
|
+
** to enable them, and negative to leave the setting unchanged.
|
|
2410
|
+
** The second argument (the fourth parameter) is a pointer to an integer
|
|
2389
2411
|
** into which is written 0 or 1 to indicate whether checkpoints-on-close
|
|
2390
2412
|
** have been disabled - 0 if they are not disabled, 1 if they are.
|
|
2391
2413
|
** </dd>
|
|
@@ -2546,7 +2568,7 @@ struct sqlite3_mem_methods {
|
|
|
2546
2568
|
** statistics. For statistics to be collected, the flag must be set on
|
|
2547
2569
|
** the database handle both when the SQL statement is prepared and when it
|
|
2548
2570
|
** is stepped. The flag is set (collection of statistics is enabled)
|
|
2549
|
-
** by default.
|
|
2571
|
+
** by default. <p>This option takes two arguments: an integer and a pointer to
|
|
2550
2572
|
** an integer.. The first argument is 1, 0, or -1 to enable, disable, or
|
|
2551
2573
|
** leave unchanged the statement scanstatus option. If the second argument
|
|
2552
2574
|
** is not NULL, then the value of the statement scanstatus setting after
|
|
@@ -2560,7 +2582,7 @@ struct sqlite3_mem_methods {
|
|
|
2560
2582
|
** in which tables and indexes are scanned so that the scans start at the end
|
|
2561
2583
|
** and work toward the beginning rather than starting at the beginning and
|
|
2562
2584
|
** working toward the end. Setting SQLITE_DBCONFIG_REVERSE_SCANORDER is the
|
|
2563
|
-
** same as setting [PRAGMA reverse_unordered_selects].
|
|
2585
|
+
** same as setting [PRAGMA reverse_unordered_selects]. <p>This option takes
|
|
2564
2586
|
** two arguments which are an integer and a pointer to an integer. The first
|
|
2565
2587
|
** argument is 1, 0, or -1 to enable, disable, or leave unchanged the
|
|
2566
2588
|
** reverse scan order flag, respectively. If the second argument is not NULL,
|
|
@@ -2569,7 +2591,76 @@ struct sqlite3_mem_methods {
|
|
|
2569
2591
|
** first argument.
|
|
2570
2592
|
** </dd>
|
|
2571
2593
|
**
|
|
2594
|
+
** [[SQLITE_DBCONFIG_ENABLE_ATTACH_CREATE]]
|
|
2595
|
+
** <dt>SQLITE_DBCONFIG_ENABLE_ATTACH_CREATE</dt>
|
|
2596
|
+
** <dd>The SQLITE_DBCONFIG_ENABLE_ATTACH_CREATE option enables or disables
|
|
2597
|
+
** the ability of the [ATTACH DATABASE] SQL command to create a new database
|
|
2598
|
+
** file if the database filed named in the ATTACH command does not already
|
|
2599
|
+
** exist. This ability of ATTACH to create a new database is enabled by
|
|
2600
|
+
** default. Applications can disable or reenable the ability for ATTACH to
|
|
2601
|
+
** create new database files using this DBCONFIG option.<p>
|
|
2602
|
+
** This option takes two arguments which are an integer and a pointer
|
|
2603
|
+
** to an integer. The first argument is 1, 0, or -1 to enable, disable, or
|
|
2604
|
+
** leave unchanged the attach-create flag, respectively. If the second
|
|
2605
|
+
** argument is not NULL, then 0 or 1 is written into the integer that the
|
|
2606
|
+
** second argument points to depending on if the attach-create flag is set
|
|
2607
|
+
** after processing the first argument.
|
|
2608
|
+
** </dd>
|
|
2609
|
+
**
|
|
2610
|
+
** [[SQLITE_DBCONFIG_ENABLE_ATTACH_WRITE]]
|
|
2611
|
+
** <dt>SQLITE_DBCONFIG_ENABLE_ATTACH_WRITE</dt>
|
|
2612
|
+
** <dd>The SQLITE_DBCONFIG_ENABLE_ATTACH_WRITE option enables or disables the
|
|
2613
|
+
** ability of the [ATTACH DATABASE] SQL command to open a database for writing.
|
|
2614
|
+
** This capability is enabled by default. Applications can disable or
|
|
2615
|
+
** reenable this capability using the current DBCONFIG option. If the
|
|
2616
|
+
** the this capability is disabled, the [ATTACH] command will still work,
|
|
2617
|
+
** but the database will be opened read-only. If this option is disabled,
|
|
2618
|
+
** then the ability to create a new database using [ATTACH] is also disabled,
|
|
2619
|
+
** regardless of the value of the [SQLITE_DBCONFIG_ENABLE_ATTACH_CREATE]
|
|
2620
|
+
** option.<p>
|
|
2621
|
+
** This option takes two arguments which are an integer and a pointer
|
|
2622
|
+
** to an integer. The first argument is 1, 0, or -1 to enable, disable, or
|
|
2623
|
+
** leave unchanged the ability to ATTACH another database for writing,
|
|
2624
|
+
** respectively. If the second argument is not NULL, then 0 or 1 is written
|
|
2625
|
+
** into the integer to which the second argument points, depending on whether
|
|
2626
|
+
** the ability to ATTACH a read/write database is enabled or disabled
|
|
2627
|
+
** after processing the first argument.
|
|
2628
|
+
** </dd>
|
|
2629
|
+
**
|
|
2630
|
+
** [[SQLITE_DBCONFIG_ENABLE_COMMENTS]]
|
|
2631
|
+
** <dt>SQLITE_DBCONFIG_ENABLE_COMMENTS</dt>
|
|
2632
|
+
** <dd>The SQLITE_DBCONFIG_ENABLE_COMMENTS option enables or disables the
|
|
2633
|
+
** ability to include comments in SQL text. Comments are enabled by default.
|
|
2634
|
+
** An application can disable or reenable comments in SQL text using this
|
|
2635
|
+
** DBCONFIG option.<p>
|
|
2636
|
+
** This option takes two arguments which are an integer and a pointer
|
|
2637
|
+
** to an integer. The first argument is 1, 0, or -1 to enable, disable, or
|
|
2638
|
+
** leave unchanged the ability to use comments in SQL text,
|
|
2639
|
+
** respectively. If the second argument is not NULL, then 0 or 1 is written
|
|
2640
|
+
** into the integer that the second argument points to depending on if
|
|
2641
|
+
** comments are allowed in SQL text after processing the first argument.
|
|
2642
|
+
** </dd>
|
|
2643
|
+
**
|
|
2572
2644
|
** </dl>
|
|
2645
|
+
**
|
|
2646
|
+
** [[DBCONFIG arguments]] <h3>Arguments To SQLITE_DBCONFIG Options</h3>
|
|
2647
|
+
**
|
|
2648
|
+
** <p>Most of the SQLITE_DBCONFIG options take two arguments, so that the
|
|
2649
|
+
** overall call to [sqlite3_db_config()] has a total of four parameters.
|
|
2650
|
+
** The first argument (the third parameter to sqlite3_db_config()) is a integer.
|
|
2651
|
+
** The second argument is a pointer to an integer. If the first argument is 1,
|
|
2652
|
+
** then the option becomes enabled. If the first integer argument is 0, then the
|
|
2653
|
+
** option is disabled. If the first argument is -1, then the option setting
|
|
2654
|
+
** is unchanged. The second argument, the pointer to an integer, may be NULL.
|
|
2655
|
+
** If the second argument is not NULL, then a value of 0 or 1 is written into
|
|
2656
|
+
** the integer to which the second argument points, depending on whether the
|
|
2657
|
+
** setting is disabled or enabled after applying any changes specified by
|
|
2658
|
+
** the first argument.
|
|
2659
|
+
**
|
|
2660
|
+
** <p>While most SQLITE_DBCONFIG options use the argument format
|
|
2661
|
+
** described in the previous paragraph, the [SQLITE_DBCONFIG_MAINDBNAME]
|
|
2662
|
+
** and [SQLITE_DBCONFIG_LOOKASIDE] options are different. See the
|
|
2663
|
+
** documentation of those exceptional options for details.
|
|
2573
2664
|
*/
|
|
2574
2665
|
#define SQLITE_DBCONFIG_MAINDBNAME 1000 /* const char* */
|
|
2575
2666
|
#define SQLITE_DBCONFIG_LOOKASIDE 1001 /* void* int int */
|
|
@@ -2591,7 +2682,10 @@ struct sqlite3_mem_methods {
|
|
|
2591
2682
|
#define SQLITE_DBCONFIG_TRUSTED_SCHEMA 1017 /* int int* */
|
|
2592
2683
|
#define SQLITE_DBCONFIG_STMT_SCANSTATUS 1018 /* int int* */
|
|
2593
2684
|
#define SQLITE_DBCONFIG_REVERSE_SCANORDER 1019 /* int int* */
|
|
2594
|
-
#define
|
|
2685
|
+
#define SQLITE_DBCONFIG_ENABLE_ATTACH_CREATE 1020 /* int int* */
|
|
2686
|
+
#define SQLITE_DBCONFIG_ENABLE_ATTACH_WRITE 1021 /* int int* */
|
|
2687
|
+
#define SQLITE_DBCONFIG_ENABLE_COMMENTS 1022 /* int int* */
|
|
2688
|
+
#define SQLITE_DBCONFIG_MAX 1022 /* Largest DBCONFIG */
|
|
2595
2689
|
|
|
2596
2690
|
/*
|
|
2597
2691
|
** CAPI3REF: Enable Or Disable Extended Result Codes
|
|
@@ -10794,8 +10888,9 @@ SQLITE_API SQLITE_EXPERIMENTAL int sqlite3_snapshot_recover(sqlite3 *db, const c
|
|
|
10794
10888
|
/*
|
|
10795
10889
|
** CAPI3REF: Serialize a database
|
|
10796
10890
|
**
|
|
10797
|
-
** The sqlite3_serialize(D,S,P,F) interface returns a pointer to
|
|
10798
|
-
** that is a serialization of the S database on
|
|
10891
|
+
** The sqlite3_serialize(D,S,P,F) interface returns a pointer to
|
|
10892
|
+
** memory that is a serialization of the S database on
|
|
10893
|
+
** [database connection] D. If S is a NULL pointer, the main database is used.
|
|
10799
10894
|
** If P is not a NULL pointer, then the size of the database in bytes
|
|
10800
10895
|
** is written into *P.
|
|
10801
10896
|
**
|
package/deps/update-sqlite3mc.sh
CHANGED
|
@@ -1,140 +1,140 @@
|
|
|
1
|
-
#!/usr/bin/env bash
|
|
2
|
-
|
|
3
|
-
# ===
|
|
4
|
-
# This script defines and generates the bundled SQLite unit (sqlite3.c).
|
|
5
|
-
#
|
|
6
|
-
# The following steps are taken:
|
|
7
|
-
# 1. populate the shell environment with the defined compile-time options.
|
|
8
|
-
# 2. download and extract the SQLite source code into a temporary directory.
|
|
9
|
-
# 3. run "sh configure" and "make sqlite3.c" within the source directory.
|
|
10
|
-
# 4. clone the SQLite3MultipleCiphers repo, replace SQLite amalgamation and patch it.
|
|
11
|
-
# 5. build the SQLite3MultipleCiphers amalgamation
|
|
12
|
-
# 6. copy the generated amalgamation into the output directory (./sqlite3).
|
|
13
|
-
# 7. export the defined compile-time options to a gyp file (./defines.gypi).
|
|
14
|
-
# 8. update the docs (../docs/compilation.md) with details of this distribution.
|
|
15
|
-
#
|
|
16
|
-
# When a user builds better-sqlite3-multiple-ciphers, the following steps are taken:
|
|
17
|
-
# 1. node-gyp loads the previously exported compile-time options (defines.gypi).
|
|
18
|
-
# 2. the copy.js script copies the bundled amalgamation into the build folder.
|
|
19
|
-
# 3. node-gyp compiles the copied sqlite3.c along with better_sqlite3.cpp.
|
|
20
|
-
# 4. node-gyp links the two resulting binaries to generate better_sqlite3.node.
|
|
21
|
-
# ===
|
|
22
|
-
|
|
23
|
-
YEAR="2025"
|
|
24
|
-
VERSION="
|
|
25
|
-
SQLITE3MC_VERSION="v2.0
|
|
26
|
-
|
|
27
|
-
# Defines below are sorted alphabetically
|
|
28
|
-
DEFINES="
|
|
29
|
-
HAVE_INT16_T=1
|
|
30
|
-
HAVE_INT32_T=1
|
|
31
|
-
HAVE_INT8_T=1
|
|
32
|
-
HAVE_STDINT_H=1
|
|
33
|
-
HAVE_UINT16_T=1
|
|
34
|
-
HAVE_UINT32_T=1
|
|
35
|
-
HAVE_UINT8_T=1
|
|
36
|
-
HAVE_USLEEP=1
|
|
37
|
-
SQLITE_DEFAULT_CACHE_SIZE=-16000
|
|
38
|
-
SQLITE_DEFAULT_FOREIGN_KEYS=1
|
|
39
|
-
SQLITE_DEFAULT_MEMSTATUS=0
|
|
40
|
-
SQLITE_DEFAULT_WAL_SYNCHRONOUS=1
|
|
41
|
-
SQLITE_DQS=0
|
|
42
|
-
SQLITE_ENABLE_COLUMN_METADATA
|
|
43
|
-
SQLITE_ENABLE_DBSTAT_VTAB
|
|
44
|
-
SQLITE_ENABLE_DESERIALIZE
|
|
45
|
-
SQLITE_ENABLE_FTS3
|
|
46
|
-
SQLITE_ENABLE_FTS3_PARENTHESIS
|
|
47
|
-
SQLITE_ENABLE_FTS4
|
|
48
|
-
SQLITE_ENABLE_FTS5
|
|
49
|
-
SQLITE_ENABLE_GEOPOLY
|
|
50
|
-
SQLITE_ENABLE_JSON1
|
|
51
|
-
SQLITE_ENABLE_MATH_FUNCTIONS
|
|
52
|
-
SQLITE_ENABLE_RTREE
|
|
53
|
-
SQLITE_ENABLE_STAT4
|
|
54
|
-
SQLITE_ENABLE_UPDATE_DELETE_LIMIT
|
|
55
|
-
SQLITE_LIKE_DOESNT_MATCH_BLOBS
|
|
56
|
-
SQLITE_OMIT_DEPRECATED
|
|
57
|
-
SQLITE_OMIT_PROGRESS_CALLBACK
|
|
58
|
-
SQLITE_OMIT_SHARED_CACHE
|
|
59
|
-
SQLITE_OMIT_TCL_VARIABLE
|
|
60
|
-
SQLITE_SOUNDEX
|
|
61
|
-
SQLITE_THREADSAFE=2
|
|
62
|
-
SQLITE_TRACE_SIZE_LIMIT=32
|
|
63
|
-
SQLITE_USER_AUTHENTICATION=0
|
|
64
|
-
SQLITE_USE_URI=0
|
|
65
|
-
"
|
|
66
|
-
|
|
67
|
-
# ========== START SCRIPT ========== #
|
|
68
|
-
|
|
69
|
-
echo -e "Setting up environment..."
|
|
70
|
-
DEPS="$(CDPATH= cd -- "$(dirname -- "$0")" && pwd)"
|
|
71
|
-
TEMP="$DEPS/temp"
|
|
72
|
-
OUTPUT="$DEPS/sqlite3"
|
|
73
|
-
rm -rf "$TEMP"
|
|
74
|
-
rm -rf "$OUTPUT"
|
|
75
|
-
mkdir -p "$TEMP"
|
|
76
|
-
mkdir -p "$OUTPUT"
|
|
77
|
-
export CFLAGS=`echo $(echo "$DEFINES" | sed -e "/^\s*$/d" -e "s/^/-D/")`
|
|
78
|
-
|
|
79
|
-
echo -e "\nDownloading SQLite source..."
|
|
80
|
-
curl -#f "https://www.sqlite.org/$YEAR/sqlite-src-$VERSION.zip" > "$TEMP/source.zip" || exit 1
|
|
81
|
-
|
|
82
|
-
echo -e "\nExtracting SQLite source..."
|
|
83
|
-
unzip "$TEMP/source.zip" -d "$TEMP" > /dev/null || exit 1
|
|
84
|
-
cd "$TEMP/sqlite-src-$VERSION" || exit 1
|
|
85
|
-
|
|
86
|
-
echo -e "\nConfiguring SQLite amalgamation..."
|
|
87
|
-
sh configure > /dev/null || exit 1
|
|
88
|
-
|
|
89
|
-
echo -e "\nBuilding SQLite amalgamation..."
|
|
90
|
-
make OPTIONS="$CFLAGS" sqlite3.c > /dev/null || exit 1
|
|
91
|
-
|
|
92
|
-
echo -e "\nCloning SQLite3MultipleCiphers repo..."
|
|
93
|
-
cd "$TEMP" || exit 1
|
|
94
|
-
git clone --quiet https://github.com/utelle/SQLite3MultipleCiphers.git > /dev/null || exit 1
|
|
95
|
-
cd "$TEMP/SQLite3MultipleCiphers" || exit 1
|
|
96
|
-
git checkout --quiet "tags/$SQLITE3MC_VERSION" > /dev/null || exit 1
|
|
97
|
-
|
|
98
|
-
echo -e "\nReplacing SQLite amalgamation in SQLite3MultipleCiphers..."
|
|
99
|
-
cd "$TEMP/sqlite-src-$VERSION" || exit 1
|
|
100
|
-
(yes | cp -rf sqlite3.c sqlite3.h sqlite3ext.h "$TEMP/SQLite3MultipleCiphers/src") || exit 1
|
|
101
|
-
|
|
102
|
-
echo -e "\nPatching SQLite amalgamation in SQLite3MultipleCiphers..."
|
|
103
|
-
cd "$TEMP/SQLite3MultipleCiphers" || exit 1
|
|
104
|
-
chmod +x ./scripts/patchsqlite3.sh || exit 1
|
|
105
|
-
chmod +x ./scripts/rekeyvacuum.sh || exit 1
|
|
106
|
-
./scripts/patchsqlite3.sh ./src/sqlite3.c >./src/sqlite3patched.c || exit 1
|
|
107
|
-
./scripts/rekeyvacuum.sh ./src/sqlite3.c >./src/rekeyvacuum.c || exit 1
|
|
108
|
-
|
|
109
|
-
echo -e "\nBuilding SQLite3MultipleCiphers amalgamation..."
|
|
110
|
-
python3 ./scripts/amalgamate.py --config ./scripts/sqlite3mc.c.json --source ./src/ || exit 1
|
|
111
|
-
mv sqlite3mc_amalgamation.c sqlite3.c || exit 1
|
|
112
|
-
python3 ./scripts/amalgamate.py --config ./scripts/sqlite3mc.h.json --source ./src/ || exit 1
|
|
113
|
-
mv sqlite3mc_amalgamation.h sqlite3.h || exit 1
|
|
114
|
-
|
|
115
|
-
echo -e "\nCopying SQLite3MultipleCiphers amalgamation..."
|
|
116
|
-
cp sqlite3.c sqlite3.h ./src/sqlite3ext.h "$OUTPUT/" || exit 1
|
|
117
|
-
|
|
118
|
-
echo -e "\nUpdating gyp configs..."
|
|
119
|
-
GYP="$DEPS/defines.gypi"
|
|
120
|
-
printf "# THIS FILE IS AUTOMATICALLY GENERATED BY deps/download.sh (DO NOT EDIT)\n\n{\n 'defines': [\n" > "$GYP"
|
|
121
|
-
printf "$DEFINES" | sed -e "/^\s*$/d" -e "s/\(.*\)/ '\1',/" >> "$GYP"
|
|
122
|
-
printf " ],\n}\n" >> "$GYP"
|
|
123
|
-
|
|
124
|
-
echo -e "\nUpdating docs..."
|
|
125
|
-
DOCS="$DEPS/../docs/compilation.md"
|
|
126
|
-
MAJOR=`expr "${VERSION:0:1}" + 0`
|
|
127
|
-
MINOR=`expr "${VERSION:1:2}" + 0`
|
|
128
|
-
PATCH=`expr "${VERSION:3:2}" + 0`
|
|
129
|
-
sed -Ei.bak -e "s/version [0-9]+\.[0-9]+\.[0-9]+/version $MAJOR.$MINOR.$PATCH/g" "$DOCS"
|
|
130
|
-
sed -i.bak -e "/^SQLITE_/,\$d" "$DOCS"
|
|
131
|
-
sed -i.bak -e "/^HAVE_/,\$d" "$DOCS"
|
|
132
|
-
rm "$DOCS".bak
|
|
133
|
-
printf "$DEFINES" | sed -e "/^\s*$/d" >> "$DOCS"
|
|
134
|
-
printf "\`\`\`\n" >> "$DOCS"
|
|
135
|
-
|
|
136
|
-
echo -e "\nCleaning up..."
|
|
137
|
-
cd - > /dev/null || exit 1
|
|
138
|
-
rm -rf "$TEMP"
|
|
139
|
-
|
|
140
|
-
echo -e "\nSQLite3MultipleCiphers update process completed!"
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
|
|
3
|
+
# ===
|
|
4
|
+
# This script defines and generates the bundled SQLite unit (sqlite3.c).
|
|
5
|
+
#
|
|
6
|
+
# The following steps are taken:
|
|
7
|
+
# 1. populate the shell environment with the defined compile-time options.
|
|
8
|
+
# 2. download and extract the SQLite source code into a temporary directory.
|
|
9
|
+
# 3. run "sh configure" and "make sqlite3.c" within the source directory.
|
|
10
|
+
# 4. clone the SQLite3MultipleCiphers repo, replace SQLite amalgamation and patch it.
|
|
11
|
+
# 5. build the SQLite3MultipleCiphers amalgamation
|
|
12
|
+
# 6. copy the generated amalgamation into the output directory (./sqlite3).
|
|
13
|
+
# 7. export the defined compile-time options to a gyp file (./defines.gypi).
|
|
14
|
+
# 8. update the docs (../docs/compilation.md) with details of this distribution.
|
|
15
|
+
#
|
|
16
|
+
# When a user builds better-sqlite3-multiple-ciphers, the following steps are taken:
|
|
17
|
+
# 1. node-gyp loads the previously exported compile-time options (defines.gypi).
|
|
18
|
+
# 2. the copy.js script copies the bundled amalgamation into the build folder.
|
|
19
|
+
# 3. node-gyp compiles the copied sqlite3.c along with better_sqlite3.cpp.
|
|
20
|
+
# 4. node-gyp links the two resulting binaries to generate better_sqlite3.node.
|
|
21
|
+
# ===
|
|
22
|
+
|
|
23
|
+
YEAR="2025"
|
|
24
|
+
VERSION="3490100"
|
|
25
|
+
SQLITE3MC_VERSION="v2.1.0"
|
|
26
|
+
|
|
27
|
+
# Defines below are sorted alphabetically
|
|
28
|
+
DEFINES="
|
|
29
|
+
HAVE_INT16_T=1
|
|
30
|
+
HAVE_INT32_T=1
|
|
31
|
+
HAVE_INT8_T=1
|
|
32
|
+
HAVE_STDINT_H=1
|
|
33
|
+
HAVE_UINT16_T=1
|
|
34
|
+
HAVE_UINT32_T=1
|
|
35
|
+
HAVE_UINT8_T=1
|
|
36
|
+
HAVE_USLEEP=1
|
|
37
|
+
SQLITE_DEFAULT_CACHE_SIZE=-16000
|
|
38
|
+
SQLITE_DEFAULT_FOREIGN_KEYS=1
|
|
39
|
+
SQLITE_DEFAULT_MEMSTATUS=0
|
|
40
|
+
SQLITE_DEFAULT_WAL_SYNCHRONOUS=1
|
|
41
|
+
SQLITE_DQS=0
|
|
42
|
+
SQLITE_ENABLE_COLUMN_METADATA
|
|
43
|
+
SQLITE_ENABLE_DBSTAT_VTAB
|
|
44
|
+
SQLITE_ENABLE_DESERIALIZE
|
|
45
|
+
SQLITE_ENABLE_FTS3
|
|
46
|
+
SQLITE_ENABLE_FTS3_PARENTHESIS
|
|
47
|
+
SQLITE_ENABLE_FTS4
|
|
48
|
+
SQLITE_ENABLE_FTS5
|
|
49
|
+
SQLITE_ENABLE_GEOPOLY
|
|
50
|
+
SQLITE_ENABLE_JSON1
|
|
51
|
+
SQLITE_ENABLE_MATH_FUNCTIONS
|
|
52
|
+
SQLITE_ENABLE_RTREE
|
|
53
|
+
SQLITE_ENABLE_STAT4
|
|
54
|
+
SQLITE_ENABLE_UPDATE_DELETE_LIMIT
|
|
55
|
+
SQLITE_LIKE_DOESNT_MATCH_BLOBS
|
|
56
|
+
SQLITE_OMIT_DEPRECATED
|
|
57
|
+
SQLITE_OMIT_PROGRESS_CALLBACK
|
|
58
|
+
SQLITE_OMIT_SHARED_CACHE
|
|
59
|
+
SQLITE_OMIT_TCL_VARIABLE
|
|
60
|
+
SQLITE_SOUNDEX
|
|
61
|
+
SQLITE_THREADSAFE=2
|
|
62
|
+
SQLITE_TRACE_SIZE_LIMIT=32
|
|
63
|
+
SQLITE_USER_AUTHENTICATION=0
|
|
64
|
+
SQLITE_USE_URI=0
|
|
65
|
+
"
|
|
66
|
+
|
|
67
|
+
# ========== START SCRIPT ========== #
|
|
68
|
+
|
|
69
|
+
echo -e "Setting up environment..."
|
|
70
|
+
DEPS="$(CDPATH= cd -- "$(dirname -- "$0")" && pwd)"
|
|
71
|
+
TEMP="$DEPS/temp"
|
|
72
|
+
OUTPUT="$DEPS/sqlite3"
|
|
73
|
+
rm -rf "$TEMP"
|
|
74
|
+
rm -rf "$OUTPUT"
|
|
75
|
+
mkdir -p "$TEMP"
|
|
76
|
+
mkdir -p "$OUTPUT"
|
|
77
|
+
export CFLAGS=`echo $(echo "$DEFINES" | sed -e "/^\s*$/d" -e "s/^/-D/")`
|
|
78
|
+
|
|
79
|
+
echo -e "\nDownloading SQLite source..."
|
|
80
|
+
curl -#f "https://www.sqlite.org/$YEAR/sqlite-src-$VERSION.zip" > "$TEMP/source.zip" || exit 1
|
|
81
|
+
|
|
82
|
+
echo -e "\nExtracting SQLite source..."
|
|
83
|
+
unzip "$TEMP/source.zip" -d "$TEMP" > /dev/null || exit 1
|
|
84
|
+
cd "$TEMP/sqlite-src-$VERSION" || exit 1
|
|
85
|
+
|
|
86
|
+
echo -e "\nConfiguring SQLite amalgamation..."
|
|
87
|
+
sh configure > /dev/null || exit 1
|
|
88
|
+
|
|
89
|
+
echo -e "\nBuilding SQLite amalgamation..."
|
|
90
|
+
make OPTIONS="$CFLAGS" sqlite3.c > /dev/null || exit 1
|
|
91
|
+
|
|
92
|
+
echo -e "\nCloning SQLite3MultipleCiphers repo..."
|
|
93
|
+
cd "$TEMP" || exit 1
|
|
94
|
+
git clone --quiet https://github.com/utelle/SQLite3MultipleCiphers.git > /dev/null || exit 1
|
|
95
|
+
cd "$TEMP/SQLite3MultipleCiphers" || exit 1
|
|
96
|
+
git checkout --quiet "tags/$SQLITE3MC_VERSION" > /dev/null || exit 1
|
|
97
|
+
|
|
98
|
+
echo -e "\nReplacing SQLite amalgamation in SQLite3MultipleCiphers..."
|
|
99
|
+
cd "$TEMP/sqlite-src-$VERSION" || exit 1
|
|
100
|
+
(yes | cp -rf sqlite3.c sqlite3.h sqlite3ext.h "$TEMP/SQLite3MultipleCiphers/src") || exit 1
|
|
101
|
+
|
|
102
|
+
echo -e "\nPatching SQLite amalgamation in SQLite3MultipleCiphers..."
|
|
103
|
+
cd "$TEMP/SQLite3MultipleCiphers" || exit 1
|
|
104
|
+
chmod +x ./scripts/patchsqlite3.sh || exit 1
|
|
105
|
+
chmod +x ./scripts/rekeyvacuum.sh || exit 1
|
|
106
|
+
./scripts/patchsqlite3.sh ./src/sqlite3.c >./src/sqlite3patched.c || exit 1
|
|
107
|
+
./scripts/rekeyvacuum.sh ./src/sqlite3.c >./src/rekeyvacuum.c || exit 1
|
|
108
|
+
|
|
109
|
+
echo -e "\nBuilding SQLite3MultipleCiphers amalgamation..."
|
|
110
|
+
python3 ./scripts/amalgamate.py --config ./scripts/sqlite3mc.c.json --source ./src/ || exit 1
|
|
111
|
+
mv sqlite3mc_amalgamation.c sqlite3.c || exit 1
|
|
112
|
+
python3 ./scripts/amalgamate.py --config ./scripts/sqlite3mc.h.json --source ./src/ || exit 1
|
|
113
|
+
mv sqlite3mc_amalgamation.h sqlite3.h || exit 1
|
|
114
|
+
|
|
115
|
+
echo -e "\nCopying SQLite3MultipleCiphers amalgamation..."
|
|
116
|
+
cp sqlite3.c sqlite3.h ./src/sqlite3ext.h "$OUTPUT/" || exit 1
|
|
117
|
+
|
|
118
|
+
echo -e "\nUpdating gyp configs..."
|
|
119
|
+
GYP="$DEPS/defines.gypi"
|
|
120
|
+
printf "# THIS FILE IS AUTOMATICALLY GENERATED BY deps/download.sh (DO NOT EDIT)\n\n{\n 'defines': [\n" > "$GYP"
|
|
121
|
+
printf "$DEFINES" | sed -e "/^\s*$/d" -e "s/\(.*\)/ '\1',/" >> "$GYP"
|
|
122
|
+
printf " ],\n}\n" >> "$GYP"
|
|
123
|
+
|
|
124
|
+
echo -e "\nUpdating docs..."
|
|
125
|
+
DOCS="$DEPS/../docs/compilation.md"
|
|
126
|
+
MAJOR=`expr "${VERSION:0:1}" + 0`
|
|
127
|
+
MINOR=`expr "${VERSION:1:2}" + 0`
|
|
128
|
+
PATCH=`expr "${VERSION:3:2}" + 0`
|
|
129
|
+
sed -Ei.bak -e "s/version [0-9]+\.[0-9]+\.[0-9]+/version $MAJOR.$MINOR.$PATCH/g" "$DOCS"
|
|
130
|
+
sed -i.bak -e "/^SQLITE_/,\$d" "$DOCS"
|
|
131
|
+
sed -i.bak -e "/^HAVE_/,\$d" "$DOCS"
|
|
132
|
+
rm "$DOCS".bak
|
|
133
|
+
printf "$DEFINES" | sed -e "/^\s*$/d" >> "$DOCS"
|
|
134
|
+
printf "\`\`\`\n" >> "$DOCS"
|
|
135
|
+
|
|
136
|
+
echo -e "\nCleaning up..."
|
|
137
|
+
cd - > /dev/null || exit 1
|
|
138
|
+
rm -rf "$TEMP"
|
|
139
|
+
|
|
140
|
+
echo -e "\nSQLite3MultipleCiphers update process completed!"
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "better-sqlite3-multiple-ciphers",
|
|
3
|
-
"version": "11.
|
|
3
|
+
"version": "11.9.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>",
|