@photostructure/sqlite 0.3.0 → 0.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/CHANGELOG.md +65 -16
- package/README.md +5 -10
- package/binding.gyp +2 -2
- package/dist/index.cjs +314 -11
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +346 -89
- package/dist/index.d.mts +346 -89
- package/dist/index.d.ts +346 -89
- package/dist/index.mjs +311 -10
- package/dist/index.mjs.map +1 -1
- package/package.json +72 -63
- package/prebuilds/darwin-arm64/@photostructure+sqlite.glibc.node +0 -0
- package/prebuilds/darwin-x64/@photostructure+sqlite.glibc.node +0 -0
- package/prebuilds/linux-arm64/@photostructure+sqlite.glibc.node +0 -0
- package/prebuilds/linux-arm64/@photostructure+sqlite.musl.node +0 -0
- package/prebuilds/linux-x64/@photostructure+sqlite.glibc.node +0 -0
- package/prebuilds/linux-x64/@photostructure+sqlite.musl.node +0 -0
- package/prebuilds/test_extension.so +0 -0
- package/prebuilds/win32-arm64/@photostructure+sqlite.glibc.node +0 -0
- package/prebuilds/win32-x64/@photostructure+sqlite.glibc.node +0 -0
- package/src/aggregate_function.cpp +222 -114
- package/src/aggregate_function.h +5 -6
- package/src/binding.cpp +30 -21
- package/src/enhance.ts +552 -0
- package/src/index.ts +84 -9
- package/src/shims/node_errors.h +34 -15
- package/src/shims/sqlite_errors.h +34 -8
- package/src/sql-tag-store.ts +6 -9
- package/src/sqlite_impl.cpp +1044 -394
- package/src/sqlite_impl.h +46 -7
- package/src/transaction.ts +178 -0
- package/src/types/database-sync-instance.ts +6 -40
- package/src/types/pragma-options.ts +23 -0
- package/src/types/statement-sync-instance.ts +38 -12
- package/src/types/transaction.ts +72 -0
- package/src/upstream/node_sqlite.cc +143 -43
- package/src/upstream/node_sqlite.h +15 -11
- package/src/upstream/sqlite3.c +102 -58
- package/src/upstream/sqlite3.h +5 -5
- package/src/user_function.cpp +138 -141
- package/src/user_function.h +3 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@photostructure/sqlite",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.0",
|
|
4
4
|
"description": "Drop-in replacement for node:sqlite",
|
|
5
5
|
"homepage": "https://photostructure.github.io/node-sqlite/",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -27,68 +27,76 @@
|
|
|
27
27
|
"private": false,
|
|
28
28
|
"scripts": {
|
|
29
29
|
"install": "node-gyp-build",
|
|
30
|
-
"
|
|
30
|
+
"//build": "build commands",
|
|
31
|
+
"build": "run-p build:dist build:native",
|
|
32
|
+
"build:dist": "tsup && node scripts/post-build.mjs",
|
|
33
|
+
"build:native": "tsx scripts/build-native.ts",
|
|
34
|
+
"build:native:linux": "bash scripts/prebuild-linux-glibc.sh",
|
|
35
|
+
"build:native:rebuild": "node-gyp rebuild",
|
|
36
|
+
"rebuild": "run-s clean build",
|
|
37
|
+
"//clean": "cleanup commands",
|
|
38
|
+
"clean": "run-p clean:dist clean:native",
|
|
31
39
|
"clean:dist": "del-cli dist \"*.tsbuildinfo\"",
|
|
32
40
|
"clean:native": "node-gyp clean && del-cli prebuilds",
|
|
41
|
+
"clean:docker": "docker rm -f $(docker ps -aq --filter name=node-sqlite-test 2>/dev/null) 2>/dev/null || true",
|
|
42
|
+
"clean:docker:cache": "del-cli .cache",
|
|
43
|
+
"clean:all": "run-p clean:dist clean:native clean:docker clean:docker:cache",
|
|
44
|
+
"//sync": "sync upstream sources",
|
|
45
|
+
"sync": "run-s sync:node sync:sqlite sync:tests",
|
|
33
46
|
"sync:node": "tsx scripts/sync-from-node.ts",
|
|
34
47
|
"sync:sqlite": "tsx scripts/sync-from-sqlite.ts",
|
|
35
|
-
"
|
|
36
|
-
"//
|
|
37
|
-
"
|
|
38
|
-
"
|
|
39
|
-
"
|
|
40
|
-
"
|
|
41
|
-
"
|
|
42
|
-
"
|
|
43
|
-
"
|
|
44
|
-
"
|
|
45
|
-
"
|
|
46
|
-
"
|
|
47
|
-
"
|
|
48
|
-
"//
|
|
49
|
-
"
|
|
50
|
-
"// test": "support `npm t name_of_file` (and don't fail due to missing coverage)",
|
|
51
|
-
"test": "npm run tests:cjs -- --no-coverage",
|
|
52
|
-
"test:serial": "npm run tests:cjs -- --runInBand --no-coverage",
|
|
53
|
-
"test:all": "run-s \"tests:cjs -- {@}\" \"tests:esm -- {@}\" --",
|
|
54
|
-
"// test:api-compat": "run by the api compatibility CI workflow",
|
|
55
|
-
"test:api-compat": "jest --config jest.config.api-compat.cjs",
|
|
56
|
-
"test:node-compat": "cross-env NODE_OPTIONS=\"--experimental-sqlite --no-warnings --expose-gc\" npm run tests:cjs -- --no-coverage test/node-compatibility.test.ts",
|
|
57
|
-
"test:build-extension": "cd test/fixtures/test-extension && node build.js",
|
|
58
|
-
"memory:test": "cross-env TEST_MEMORY=1 node --expose-gc node_modules/jest/bin/jest.js --no-coverage test/memory.test.ts",
|
|
59
|
-
"memory:valgrind": "bash scripts/valgrind-test.sh",
|
|
60
|
-
"memory:asan": "bash scripts/sanitizers-test.sh",
|
|
61
|
-
"check:memory": "npx --yes tsx scripts/check-memory.ts",
|
|
62
|
-
"benchmark": "cd benchmark && npm install && npm run bench",
|
|
63
|
-
"benchmark:memory": "cd benchmark && npm install && npm run bench:memory",
|
|
64
|
-
"benchmark:full": "cd benchmark && npm install && npm run bench && npm run bench:memory",
|
|
65
|
-
"stress-test": "cd benchmark && npm install && cd .. && tsx scripts/stress-test.ts",
|
|
66
|
-
"stress-test:validate": "npm run tests:cjs -- --no-coverage benchmark/stress-test.test.ts",
|
|
67
|
-
"stress-test:ci": "cd benchmark && npm install && cd .. && tsx scripts/stress-test.ts --ci --output-file stress-test-results.json",
|
|
68
|
-
"lint": "run-p lint:*",
|
|
48
|
+
"sync:tests": "tsx scripts/sync-node-tests.ts",
|
|
49
|
+
"//test": "'test' is quick dev feedback, 'test:all' is comprehensive",
|
|
50
|
+
"test": "npm run build:dist && node --expose-gc node_modules/jest/bin/jest.js --no-coverage",
|
|
51
|
+
"test:cjs": "node --expose-gc node_modules/jest/bin/jest.js",
|
|
52
|
+
"test:esm": "cross-env TEST_ESM=1 node --expose-gc --experimental-vm-modules --no-warnings node_modules/jest/bin/jest.js",
|
|
53
|
+
"test:all": "npm run build && run-s test:cjs test:esm",
|
|
54
|
+
"test:serial": "node --expose-gc node_modules/jest/bin/jest.js --runInBand --no-coverage",
|
|
55
|
+
"test:api": "jest --config jest.config.api-compat.cjs",
|
|
56
|
+
"test:node": "node --test test/node-compat/*.js test/node-compat/*.mjs",
|
|
57
|
+
"test:memory": "cross-env TEST_MEMORY=1 node --expose-gc node_modules/jest/bin/jest.js --no-coverage test/memory.test.ts",
|
|
58
|
+
"test:extension": "cd test/fixtures/test-extension && node build.js",
|
|
59
|
+
"test:docker:debian": "REUSE_BUILD=1 REUSE_CONTAINER=1 bash scripts/test-docker-debian.sh",
|
|
60
|
+
"test:docker:alpine": "REUSE_BUILD=1 REUSE_CONTAINER=1 bash scripts/test-docker-alpine.sh",
|
|
61
|
+
"//lint": "'lint' runs everywhere, 'lint:full' adds optional tools",
|
|
62
|
+
"lint": "run-p lint:ts lint:eslint",
|
|
69
63
|
"lint:ts": "tsc --noEmit",
|
|
70
|
-
"lint:ts
|
|
71
|
-
"lint:ts
|
|
72
|
-
"lint:ts
|
|
64
|
+
"lint:ts:build": "tsc -p tsconfig.build.json --noEmit",
|
|
65
|
+
"lint:ts:scripts": "tsc --noEmit --module esnext --target es2022 --moduleResolution node --project scripts/tsconfig.json",
|
|
66
|
+
"lint:ts:bench": "cd benchmark && npm install && tsc --noEmit",
|
|
73
67
|
"lint:eslint": "eslint src/ test/ scripts/",
|
|
74
|
-
"// lint:api-compat": "run by the api compatibility CI workflow",
|
|
75
|
-
"lint:api-compat": "tsx scripts/check-api-compat.ts",
|
|
76
68
|
"lint:native": "tsx scripts/clang-tidy.ts",
|
|
77
|
-
"
|
|
78
|
-
"
|
|
79
|
-
"//
|
|
69
|
+
"lint:api": "tsx scripts/check-api-compat.ts",
|
|
70
|
+
"lint:full": "run-s lint lint:native lint:api",
|
|
71
|
+
"//fmt": "code formatting",
|
|
72
|
+
"fmt": "run-p fmt:prettier fmt:native",
|
|
73
|
+
"fmt:prettier": "prettier --cache --write .",
|
|
80
74
|
"fmt:native": "clang-format --style=LLVM -i src/shims/*.h src/*.cpp src/*.h test/fixtures/test-extension/*.c || true",
|
|
75
|
+
"//memory": "memory analysis tools",
|
|
76
|
+
"memory:check": "npx --yes tsx scripts/check-memory.ts",
|
|
77
|
+
"memory:valgrind": "bash scripts/valgrind-test.sh",
|
|
78
|
+
"memory:asan": "bash scripts/sanitizers-test.sh",
|
|
79
|
+
"//bench": "benchmarks",
|
|
80
|
+
"bench": "cd benchmark && npm install && npm run bench",
|
|
81
|
+
"bench:memory": "cd benchmark && npm install && npm run bench:memory",
|
|
82
|
+
"bench:full": "cd benchmark && npm install && npm run bench && npm run bench:memory",
|
|
83
|
+
"//stress": "stress tests",
|
|
84
|
+
"stress": "cd benchmark && npm install && cd .. && tsx scripts/stress-test.ts",
|
|
85
|
+
"stress:validate": "node --expose-gc node_modules/jest/bin/jest.js --no-coverage benchmark/stress-test.test.ts",
|
|
86
|
+
"stress:ci": "cd benchmark && npm install && cd .. && tsx scripts/stress-test.ts --ci --output-file stress-test-results.json",
|
|
87
|
+
"//security": "security scanning",
|
|
88
|
+
"security": "run-s security:audit security:osv",
|
|
89
|
+
"security:audit": "npm audit --production",
|
|
90
|
+
"security:audit:fix": "npm audit fix --force",
|
|
91
|
+
"security:osv": "osv-scanner scan --recursive . || true",
|
|
92
|
+
"//docs": "documentation",
|
|
81
93
|
"docs": "typedoc",
|
|
82
|
-
"//
|
|
94
|
+
"//ci": "CI and release commands",
|
|
83
95
|
"precommit": "npx --yes tsx scripts/precommit.ts",
|
|
84
|
-
"prepare
|
|
85
|
-
"
|
|
86
|
-
"security:audit-fix": "npm audit fix --force",
|
|
87
|
-
"security:audit": "npm audit --production",
|
|
96
|
+
"release:prepare": "npm run build:dist",
|
|
97
|
+
"update:actions": "pinact run -u",
|
|
88
98
|
"install:osv-scanner": "go install github.com/google/osv-scanner/cmd/osv-scanner@latest",
|
|
89
|
-
"
|
|
90
|
-
"install:actions": "go install github.com/suzuki-shunsuke/pinact/cmd/pinact@latest",
|
|
91
|
-
"update:actions": "pinact run -u"
|
|
99
|
+
"install:actions": "go install github.com/suzuki-shunsuke/pinact/cmd/pinact@latest"
|
|
92
100
|
},
|
|
93
101
|
"gypfile": true,
|
|
94
102
|
"publishConfig": {
|
|
@@ -124,31 +132,32 @@
|
|
|
124
132
|
"node-gyp-build": "^4.8.4"
|
|
125
133
|
},
|
|
126
134
|
"devDependencies": {
|
|
135
|
+
"@mceachen/sqlite-vec": "^0.3.2",
|
|
127
136
|
"@types/jest": "^30.0.0",
|
|
128
|
-
"@types/node": "^
|
|
129
|
-
"better-sqlite3": "^12.
|
|
137
|
+
"@types/node": "^25.0.3",
|
|
138
|
+
"better-sqlite3": "^12.6.2",
|
|
130
139
|
"cross-env": "^10.1.0",
|
|
131
140
|
"del-cli": "^7.0.0",
|
|
132
|
-
"eslint": "^9.39.
|
|
133
|
-
"eslint-plugin-regexp": "^
|
|
141
|
+
"eslint": "^9.39.2",
|
|
142
|
+
"eslint-plugin-regexp": "^3.0.0",
|
|
134
143
|
"eslint-plugin-security": "^3.0.1",
|
|
135
|
-
"globals": "^
|
|
144
|
+
"globals": "^17.0.0",
|
|
136
145
|
"jest": "^30.2.0",
|
|
137
|
-
"node-gyp": "^12.
|
|
146
|
+
"node-gyp": "^12.2.0",
|
|
138
147
|
"npm-check-updates": "^19",
|
|
139
148
|
"npm-run-all2": "8.0.4",
|
|
140
149
|
"prebuildify": "^6.0.1",
|
|
141
|
-
"prettier": "^3.
|
|
150
|
+
"prettier": "^3.8.1",
|
|
142
151
|
"prettier-plugin-organize-imports": "^4.3.0",
|
|
143
152
|
"ts-jest": "^29.4.6",
|
|
144
153
|
"tsup": "^8.5.1",
|
|
145
154
|
"tsx": "^4.21.0",
|
|
146
|
-
"typedoc": "^0.28.
|
|
155
|
+
"typedoc": "^0.28.16",
|
|
147
156
|
"typescript": "^5.9.3",
|
|
148
|
-
"typescript-eslint": "^8.
|
|
157
|
+
"typescript-eslint": "^8.54.0"
|
|
149
158
|
},
|
|
150
159
|
"versions": {
|
|
151
|
-
"nodejs": "v25.
|
|
152
|
-
"sqlite": "3.51.
|
|
160
|
+
"nodejs": "v25.6.1@dffcdb3",
|
|
161
|
+
"sqlite": "3.51.2"
|
|
153
162
|
}
|
|
154
163
|
}
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|