@rocicorp/zero-sqlite3 1.0.8 → 1.0.10
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 +1 -0
- package/binding.gyp +1 -1
- package/deps/defines.gypi +1 -0
- package/deps/download.sh +6 -5
- package/deps/sqlite3/shell.c +1171 -512
- package/deps/sqlite3/sqlite3.c +6515 -4034
- package/deps/sqlite3/sqlite3.h +272 -73
- package/deps/sqlite3/sqlite3ext.h +4 -0
- package/deps/sqlite3.gyp +1 -1
- package/deps/test_extension.c +1 -1
- package/lib/database.js +13 -1
- package/lib/index.d.ts +30 -0
- package/lib/methods/transaction.js +3 -0
- package/package.json +9 -8
- package/src/addon.cpp +47 -0
- package/src/better_sqlite3.cpp +55 -2115
- package/src/objects/backup.cpp +120 -0
- package/src/objects/backup.hpp +36 -0
- package/src/objects/database.cpp +392 -0
- package/src/objects/database.hpp +102 -0
- package/src/objects/statement-iterator.cpp +113 -0
- package/src/objects/statement-iterator.hpp +50 -0
- package/src/objects/statement.cpp +446 -0
- package/src/objects/statement.hpp +59 -0
- package/src/util/bind-map.cpp +73 -0
- package/src/util/binder.cpp +193 -0
- package/src/util/constants.cpp +172 -0
- package/src/util/custom-aggregate.cpp +121 -0
- package/src/util/custom-function.cpp +59 -0
- package/src/util/custom-table.cpp +409 -0
- package/src/util/data-converter.cpp +17 -0
- package/src/util/data.cpp +194 -0
- package/src/util/helpers.cpp +109 -0
- package/src/util/macros.cpp +63 -0
- package/src/util/query-macros.cpp +71 -0
- package/src/util/row-builder.cpp +49 -0
- package/src/better_sqlite3.hpp +0 -1034
package/README.md
CHANGED
|
@@ -4,5 +4,6 @@ So far the changes are:
|
|
|
4
4
|
|
|
5
5
|
* Build the [bedrock](https://sqlite.org/src/timeline?r=bedrock) branch of SQLite to enable [`begin concurrent`](https://www.sqlite.org/src/doc/begin-concurrent/doc/begin_concurrent.md).
|
|
6
6
|
* Create a shell too, so we can debug db files created
|
|
7
|
+
* Supports both Node.js (20.x, 22.x, 23.x, 24.x) and Bun (>=1.1.0) runtimes
|
|
7
8
|
|
|
8
9
|
Other changes will be likely be made over time.
|
package/binding.gyp
CHANGED
package/deps/defines.gypi
CHANGED
package/deps/download.sh
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
#!/usr/bin/env bash
|
|
2
2
|
|
|
3
3
|
# ===
|
|
4
|
-
# This script defines and generates the bundled
|
|
4
|
+
# This script defines and generates the bundled SQLite unit (sqlite3.c).
|
|
5
5
|
#
|
|
6
6
|
# The following steps are taken:
|
|
7
7
|
# 1. populate the shell environment with the defined compile-time options.
|
|
8
|
-
# 2. download and extract the
|
|
8
|
+
# 2. download and extract the SQLite source code into a temporary directory.
|
|
9
9
|
# 3. run "sh configure" and "make sqlite3.c" within the source directory.
|
|
10
10
|
# 4. copy the generated amalgamation into the output directory (./sqlite3).
|
|
11
11
|
# 5. export the defined compile-time options to a gyp file (./defines.gypi).
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
# 4. node-gyp links the two resulting binaries to generate better_sqlite3.node.
|
|
19
19
|
# ===
|
|
20
20
|
|
|
21
|
-
CHECKIN="
|
|
21
|
+
CHECKIN="54b88880"
|
|
22
22
|
|
|
23
23
|
# Defines below are sorted alphabetically
|
|
24
24
|
DEFINES="
|
|
@@ -47,6 +47,7 @@ SQLITE_ENABLE_JSON1
|
|
|
47
47
|
SQLITE_ENABLE_MATH_FUNCTIONS
|
|
48
48
|
SQLITE_ENABLE_RTREE
|
|
49
49
|
SQLITE_ENABLE_STAT4
|
|
50
|
+
SQLITE_ENABLE_STMT_SCANSTATUS
|
|
50
51
|
SQLITE_ENABLE_UPDATE_DELETE_LIMIT
|
|
51
52
|
SQLITE_LIKE_DOESNT_MATCH_BLOBS
|
|
52
53
|
SQLITE_OMIT_DEPRECATED
|
|
@@ -73,7 +74,7 @@ mkdir -p "$OUTPUT"
|
|
|
73
74
|
export CFLAGS=`echo $(echo "$DEFINES" | sed -e "/^\s*$/d" -e "s/^/-D/")`
|
|
74
75
|
|
|
75
76
|
echo "downloading source..."
|
|
76
|
-
curl -#f "https://sqlite.org/src/zip/$CHECKIN/SQLite-$CHECKIN.zip" > "$TEMP/source.zip" || exit 1
|
|
77
|
+
curl -#f "https://www.sqlite.org/src/zip/$CHECKIN/SQLite-$CHECKIN.zip" > "$TEMP/source.zip" || exit 1
|
|
77
78
|
|
|
78
79
|
echo "extracting source..."
|
|
79
80
|
unzip "$TEMP/source.zip" -d "$TEMP" > /dev/null || exit 1
|
|
@@ -83,7 +84,7 @@ echo "configuring amalgamation..."
|
|
|
83
84
|
sh configure > /dev/null || exit 1
|
|
84
85
|
|
|
85
86
|
echo "building amalgamation..."
|
|
86
|
-
make sqlite3.c > /dev/null || exit 1
|
|
87
|
+
make OPTIONS="$CFLAGS" sqlite3.c > /dev/null || exit 1
|
|
87
88
|
|
|
88
89
|
echo "copying amalgamation..."
|
|
89
90
|
cp sqlite3.c sqlite3.h sqlite3ext.h shell.c "$OUTPUT/" || exit 1
|