Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable the use of PRAGMA Key to encrypt db #1018

Open
wants to merge 108 commits into
base: revert-982-linux-image-bump
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
108 commits
Select commit Hold shift + click to select a range
c88ca6d
Move repetitive build commands into environment variables (#989)
m4heshd Apr 19, 2023
aaa8850
Fix the build workflow broken by #989 (#994)
m4heshd Apr 19, 2023
ec51397
Add support for Node v20 prebuilds (#1000)
Chicken May 1, 2023
2843e1f
Remove node.js v14 builds and tests (runtime EOL) (#1001)
m4heshd May 1, 2023
c37b7ee
Fix out-of-bounds read in statement tail parser (#996)
arimah May 2, 2023
9b63caf
Update SQLite to version 3.42.0 (#1011)
JoshuaWise May 20, 2023
e00d110
8.4.0
mceachen May 20, 2023
7eeab2f
Add support for electron `v25` prebuilds (#1013)
m4heshd May 29, 2023
38554b5
8.5.0
mceachen Jul 19, 2023
40be681
Add support for electron `v26` prebuilds (#1042)
m4heshd Aug 17, 2023
f97ec71
8.5.1
mceachen Aug 17, 2023
37e07d4
prebuild for Node on macOS+arm64 and Windows+ia32 (#1002)
verhovsky Aug 24, 2023
5a0ee2f
8.5.2
mceachen Aug 24, 2023
653eaaa
Upgrade dependencies (#1052)
mceachen Sep 2, 2023
0092d43
Fix db::serialize() crashing with Electron (#1036)
DamienEspitallier Sep 2, 2023
5f7f4d0
Fix: Create target directory when copying (#1030)
felixrieseberg Sep 2, 2023
9573de8
fix result code type in SQliteError documentation (#1009)
cedricvanrompay Sep 2, 2023
ccf0b35
Remove SQLITE_INTROSPECTION_PRAGMAS compile-time option (#927)
threema-danilo Sep 2, 2023
3400cb0
feat(database): now `nativeBinding` supports addon object (#974)
destyk Sep 2, 2023
f11c36c
general cleanup
JoshuaWise Sep 2, 2023
6ee3399
upgraded to SQLite 3.43.0
JoshuaWise Sep 2, 2023
69fbb70
updated test
JoshuaWise Sep 2, 2023
8ed0172
updated test
JoshuaWise Sep 2, 2023
6c99a02
updated test
JoshuaWise Sep 2, 2023
a328947
updated test
JoshuaWise Sep 2, 2023
3b6410e
updated test
JoshuaWise Sep 2, 2023
bed16bf
updated test
JoshuaWise Sep 2, 2023
ae23e69
8.6.0
JoshuaWise Sep 2, 2023
b7eb1ff
Update SQLite to version 3.43.1 (#1077)
JoshuaWise Sep 30, 2023
e3f916d
8.7.0
mceachen Sep 30, 2023
051b503
Update compilation.md (#1079)
Prinzhorn Oct 6, 2023
a0189f9
Add support for electron `v27` prebuilds (#1082)
m4heshd Oct 10, 2023
ce10309
update prebuild and remove node-gyp version override (#1059)
neoxpert Oct 10, 2023
5a6f47b
Stop building and testing against Node `v16` (runtime EOL) (#1061)
m4heshd Oct 10, 2023
3e0b2df
Update SQLite to version 3.43.2 (#1083)
JoshuaWise Oct 10, 2023
007d43e
9.0.0
mceachen Oct 10, 2023
12fde8d
Update SQLite to version 3.44.0 (#1097)
JoshuaWise Nov 8, 2023
20e96c4
9.1.0
mceachen Nov 8, 2023
7908b5c
Fix macOS and future Alpine prebuilds (#1100)
mceachen Nov 9, 2023
6108911
9.1.1
JoshuaWise Nov 9, 2023
e014274
Upgrade GitHub actions/checkout and actions/setup-node (#1107)
cclauss Nov 21, 2023
8a60aa4
Update SQLite to version 3.44.2 (#1112)
JoshuaWise Dec 2, 2023
746d8e3
9.2.0
mceachen Dec 2, 2023
8cd3d46
Add support for electron `v28` prebuilds (#1113)
m4heshd Dec 5, 2023
2c79043
9.2.1
mceachen Dec 5, 2023
2babc21
9.2.2
mceachen Dec 5, 2023
5a86096
Update SQLite to version 3.45.0 (#1130)
JoshuaWise Jan 16, 2024
bd55c76
9.3.0
mceachen Jan 17, 2024
fd93895
Update SQLite to version 3.45.1 (#1133)
JoshuaWise Feb 2, 2024
543c0f5
9.4.0
mceachen Feb 2, 2024
2dabc23
Build `arm` based macOS builds natively (#1135)
m4heshd Feb 8, 2024
f60d032
Add support for Windows `arm64` prebuilds (#1141)
m4heshd Feb 10, 2024
a36b8e4
9.4.1
mceachen Feb 10, 2024
d24234b
Add support for electron `v29` prebuilds (#1147)
m4heshd Feb 21, 2024
a28bf42
9.4.2
mceachen Feb 21, 2024
eada642
Temporarily disable builds for electron `v29` (#1148)
m4heshd Feb 22, 2024
b35e089
9.4.3
mceachen Feb 22, 2024
60763a0
fix: support SpatiaLite extension (#1137)
merceyz Feb 22, 2024
e28e04a
Support builds for Electron v29 (#1151)
neoxpert Apr 3, 2024
e7d0edb
Keep GitHub Actions up to date with GitHub's Dependabot (#1165)
cclauss Apr 3, 2024
ac8f293
Clarify error handling behavior for nested transactions in docs (#1160)
nikwen Apr 3, 2024
0374765
Bump the github-actions group with 4 updates (#1167)
dependabot[bot] Apr 3, 2024
080f863
9.4.4
JoshuaWise Apr 3, 2024
3e629d9
added flag for new python version in build jobs
JoshuaWise Apr 3, 2024
126bb57
Merge branch 'master' of github.com:JoshuaWise/better-sqlite3
JoshuaWise Apr 3, 2024
1220731
fixed typo
JoshuaWise Apr 3, 2024
030801f
selectively add flag for macos-14
JoshuaWise Apr 3, 2024
e09670c
9.4.5
JoshuaWise Apr 3, 2024
ef6541b
Update SQLite to version 3.45.2 (#1173)
JoshuaWise Apr 10, 2024
67d69e5
9.5.0
mceachen Apr 10, 2024
920013e
Add support for electron `v30` prebuilds (#1175)
m4heshd Apr 26, 2024
1b4cdd3
Update SQLite to version 3.45.3 (#1179)
JoshuaWise Apr 26, 2024
cfc69bd
9.6.0
mceachen Apr 26, 2024
320fcaf
Update troubleshooting.md (#1178)
mceachen Apr 26, 2024
608f115
Fix python setuptools on macOS (#1181)
mceachen Apr 29, 2024
2327f9a
Add Node.js v22. Drop ancient EOL versions of Node.js and Electron (#…
mceachen May 12, 2024
a86a92d
10.0.0
mceachen May 12, 2024
4f3924c
Update SQLite to version 3.46.0 (#1190)
JoshuaWise May 30, 2024
5aa855e
10.1.0
mceachen May 30, 2024
f120eef
Drop prebuilds of Node.js v21 and Electron v25 (#1191)
mceachen May 30, 2024
afb31e0
Relax allowed timeout (GHA on macOS is slow) (#1193)
mceachen May 30, 2024
6c6b3df
10.1.1
mceachen May 31, 2024
6acc3fc
11.0.0
mceachen May 31, 2024
5ae61c3
Support builds for Electron v31 (#1200)
neoxpert Jun 11, 2024
7ee4464
cleaned up poorly named template
JoshuaWise Jun 11, 2024
b5d0478
Run prebuilds before publish (#1202)
mceachen Jun 12, 2024
b615a52
11.1.0
mceachen Jun 12, 2024
74f7c4a
Fix macOS x64 builds (#1210)
m4heshd Jun 27, 2024
8b74050
error C2099: initializer is not a constant (#1208)
LqdBcnAtWork Jun 27, 2024
309cb37
11.1.1
mceachen Jun 27, 2024
50ace3b
Use node bullseye to build arm images (#1216)
viceice Jul 2, 2024
254b8e9
11.1.2
mceachen Jul 2, 2024
6eb32eb
Support builds for Electron v32 (#1226)
neoxpert Aug 13, 2024
31e0e0c
Adding SQLITE_ENABLE_DBSTAT_VTAB (#1228)
mikeburgh Aug 15, 2024
c3c2393
11.2.0
mceachen Aug 21, 2024
2bf975e
Prebuild for Electron 32 (#1242)
neoxpert Aug 21, 2024
7896456
11.2.1
mceachen Aug 21, 2024
f396b5b
Add new patch infra. (#1239)
mceachen Aug 29, 2024
8b584ef
Update SQLite to version 3.46.1 (#1252)
JoshuaWise Sep 10, 2024
f01e0e4
11.3.0
mceachen Sep 10, 2024
abd3546
Prebuild for Electron 33 (#1279)
oliverschwendener Oct 17, 2024
667d2f3
11.4.0
mceachen Oct 17, 2024
698cc85
Added NodeJS 23 Support (#1283)
neoxpert Oct 20, 2024
487007a
Update SQLite to version 3.47.0 (#1284)
JoshuaWise Oct 21, 2024
5d410bb
11.5.0
mceachen Oct 21, 2024
ab644ac
Issue #1271: Added missing SQLite Error code identifier. (#1273)
Meztlicoatl Oct 29, 2024
9fc53fe
ran lzz
JoshuaWise Oct 29, 2024
b34c9f5
added new result codes
JoshuaWise Oct 29, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Keep GitHub Actions up to date with GitHub's Dependabot...
# https://docs.github.com/en/code-security/dependabot/working-with-dependabot/keeping-your-actions-up-to-date-with-dependabot
# https://docs.github.com/en/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file#package-ecosystem
version: 2
updates:
- package-ecosystem: github-actions
directory: /
groups:
github-actions:
patterns:
- "*" # Group all Actions updates into a single larger pull request
schedule:
interval: weekly
127 changes: 91 additions & 36 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,112 +12,167 @@ on:
- released
workflow_dispatch: {}

env:
# See https://github.com/nodejs/release#release-schedule
# Node.js v16 EOL = 2023-09-11. v21 EOL = 2024-06-01.
NODE_BUILD_CMD: npx --no-install prebuild -r node -t 18.0.0 -t 20.0.0 -t 22.0.0 -t 23.0.0 --include-regex 'better_sqlite3.node$'
# Merge with NODE_BUILD_CMD when Node.js v18 is EOL
NO_V18_NODE_BUILD_CMD: npx --no-install prebuild -r node -t 20.0.0 -t 22.0.0 -t 23.0.0 --include-regex 'better_sqlite3.node$'
# See https://www.electronjs.org/docs/latest/tutorial/electron-timelines#version-support-policy
# Electron v25 EOL = 2023-12-05. v26 EOL = 2024-02-20. v27 EOL = 2024-04-16. v28 EOL = 2024-06-11. v29 EOL = 2024-08-20.
ELECTRON_BUILD_CMD: npx --no-install prebuild -r electron -t 26.0.0 -t 27.0.0 -t 28.0.0 -t 29.0.0 -t 30.0.0 -t 31.0.0 -t 32.0.0 -t 33.0.0 --include-regex 'better_sqlite3.node$'

jobs:
test:
strategy:
matrix:
os:
- ubuntu-20.04
- macos-latest
- macos-13
- macos-14
- windows-2019
node:
- 14
- 16
- 18
- 19
- 20
- 22
- 23
name: Testing Node ${{ matrix.node }} on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}
- if: ${{ startsWith(matrix.os, 'windows') }}
run: pip.exe install setuptools
- if: ${{ startsWith(matrix.os, 'macos') }}
run: brew install python-setuptools
- if: ${{ !startsWith(matrix.os, 'windows') && !startsWith(matrix.os, 'macos') }}
run: python3 -m pip install setuptools
- if: ${{ startsWith(matrix.os, 'ubuntu') }}
run: |
sudo apt update
sudo apt install gcc-10 g++-10 -y
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-10 100 --slave /usr/bin/g++ g++ /usr/bin/g++-10 --slave /usr/bin/gcov gcov /usr/bin/gcov-10
- run: npm install --ignore-scripts
- run: npm run build-debug
- run: npm test
- name: Test SpatiaLite extension
if: ${{ startsWith(matrix.os, 'ubuntu') }}
run: |
sudo apt update
sudo apt install libsqlite3-mod-spatialite -y
node -e "require('./lib/index.js')(':memory:').loadExtension('mod_spatialite').exec('SELECT InitSpatialMetaData();')"

publish:
if: ${{ github.event_name == 'release' }}
name: Publishing to NPM
runs-on: ubuntu-20.04
needs: test
needs:
- prebuild
- prebuild-alpine
- prebuild-alpine-arm
- prebuild-linux-arm
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 16
node-version: 18
registry-url: https://registry.npmjs.org
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

prebuild:
if: ${{ github.event_name == 'release' }}
strategy:
fail-fast: false
matrix:
os:
- ubuntu-20.04
- macos-latest
- macos-13
- macos-14
- windows-2019
name: Prebuild on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
needs: publish
needs: test
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 16
node-version: 18
- if: ${{ startsWith(matrix.os, 'windows') }}
run: pip.exe install setuptools
- if: ${{ startsWith(matrix.os, 'macos') }}
run: brew install python-setuptools
- if: ${{ !startsWith(matrix.os, 'windows') && !startsWith(matrix.os, 'macos') }}
run: python3 -m pip install setuptools
- if: ${{ startsWith(matrix.os, 'ubuntu') }}
run: |
sudo apt update
sudo apt install gcc-10 g++-10 -y
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-10 100 --slave /usr/bin/g++ g++ /usr/bin/g++-10 --slave /usr/bin/gcov gcov /usr/bin/gcov-10
- run: npm install --ignore-scripts
- run: npx --no-install prebuild -r node -t 14.0.0 -t 16.0.0 -t 18.0.0 --include-regex 'better_sqlite3.node$' -u ${{ secrets.GITHUB_TOKEN }}
- run: npx --no-install prebuild -r electron -t 16.0.0 -t 17.0.0 -t 18.0.0 -t 19.0.0 -t 20.0.0 -t 21.0.0 -t 22.0.0 -t 23.0.0 -t 24.0.0 --include-regex 'better_sqlite3.node$' -u ${{ secrets.GITHUB_TOKEN }}
- run: ${{ env.NODE_BUILD_CMD }} -u ${{ secrets.GITHUB_TOKEN }}
- run: ${{ env.ELECTRON_BUILD_CMD }} -u ${{ secrets.GITHUB_TOKEN }}
- if: matrix.os == 'windows-2019'
run: npx --no-install prebuild -r electron -t 16.0.0 -t 17.0.0 -t 18.0.0 -t 19.0.0 -t 20.0.0 -t 21.0.0 -t 22.0.0 -t 23.0.0 -t 24.0.0 --include-regex 'better_sqlite3.node$' --arch ia32 -u ${{ secrets.GITHUB_TOKEN }}
- if: matrix.os == 'macos-latest'
run: npx --no-install prebuild -r electron -t 16.0.0 -t 17.0.0 -t 18.0.0 -t 19.0.0 -t 20.0.0 -t 21.0.0 -t 22.0.0 -t 23.0.0 -t 24.0.0 --include-regex 'better_sqlite3.node$' --arch arm64 -u ${{ secrets.GITHUB_TOKEN }}
run: |
${{ env.NODE_BUILD_CMD }} --arch ia32 -u ${{ secrets.GITHUB_TOKEN }}
${{ env.NO_V18_NODE_BUILD_CMD }} --arch arm64 -u ${{ secrets.GITHUB_TOKEN }}
${{ env.ELECTRON_BUILD_CMD }} --arch ia32 -u ${{ secrets.GITHUB_TOKEN }}
${{ env.ELECTRON_BUILD_CMD }} --arch arm64 -u ${{ secrets.GITHUB_TOKEN }}

prebuild-alpine:
if: ${{ github.event_name == 'release' }}
strategy:
fail-fast: false
name: Prebuild on alpine
runs-on: ubuntu-latest
container: node:16-alpine
needs: publish
container: node:18-alpine
needs: test
steps:
- uses: actions/checkout@v3
- run: apk add build-base git python3 --update-cache
- uses: actions/checkout@v4
- run: apk add build-base git python3 py3-setuptools --update-cache
- run: npm install --ignore-scripts
- run: npx --no-install prebuild -r node -t 14.0.0 -t 16.0.0 -t 18.0.0 --include-regex 'better_sqlite3.node$' -u ${{ secrets.GITHUB_TOKEN }}
- run: ${{ env.NODE_BUILD_CMD }} -u ${{ secrets.GITHUB_TOKEN }}

prebuild-alpine-arm:
if: ${{ github.event_name == 'release' }}
strategy:
fail-fast: false
matrix:
arch:
- arm/v7
- arm64
name: Prebuild on alpine (${{ matrix.arch }})
runs-on: ubuntu-latest
needs: publish
needs: test
steps:
- uses: actions/checkout@v3
- uses: docker/setup-qemu-action@v1
- uses: actions/checkout@v4
- uses: docker/setup-qemu-action@v3
- run: |
docker run --rm -v $(pwd):/tmp/project --entrypoint /bin/sh --platform linux/${{ matrix.arch }} node:16-alpine -c "\
apk add build-base git python3 --update-cache && \
docker run --rm -v $(pwd):/tmp/project --entrypoint /bin/sh --platform linux/${{ matrix.arch }} node:18-alpine -c "\
apk add build-base git python3 py3-setuptools --update-cache && \
cd /tmp/project && \
npm install --ignore-scripts && \
npx --no-install prebuild -r node -t 14.0.0 -t 16.0.0 -t 18.0.0 --include-regex 'better_sqlite3.node$' -u ${{ secrets.GITHUB_TOKEN }}"
${{ env.NODE_BUILD_CMD }} -u ${{ secrets.GITHUB_TOKEN }}"

prebuild-linux-arm:
if: ${{ github.event_name == 'release' }}
strategy:
fail-fast: false
matrix:
arch:
- arm/v7
- arm64
name: Prebuild on Linux (${{ matrix.arch }})
runs-on: ubuntu-latest
needs: publish
needs: test
steps:
- uses: actions/checkout@v3
- uses: docker/setup-qemu-action@v1
- uses: actions/checkout@v4
- uses: docker/setup-qemu-action@v3
- run: |
docker run --rm -v $(pwd):/tmp/project --entrypoint /bin/sh --platform linux/${{ matrix.arch }} node:16 -c "\
docker run --rm -v $(pwd):/tmp/project --entrypoint /bin/sh --platform linux/${{ matrix.arch }} node:18-bullseye -c "\
cd /tmp/project && \
npm install --ignore-scripts && \
npx --no-install prebuild -r node -t 14.0.0 -t 16.0.0 -t 18.0.0 --include-regex 'better_sqlite3.node$' -u ${{ secrets.GITHUB_TOKEN }}"
${{ env.NODE_BUILD_CMD }} -u ${{ secrets.GITHUB_TOKEN }}"
6 changes: 3 additions & 3 deletions .github/workflows/bump-version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@ jobs:
name: Bump to a new version
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
token: ${{ secrets.PAT }}
fetch-depth: 0
- uses: actions/setup-node@v3
- uses: actions/setup-node@v4
with:
node-version: 16
node-version: 18
- name: Configure user
run: |
git config --local user.name "${{ github.actor }}"
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/update-sqlite.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@ jobs:
ENV_YEAR: ${{ github.event.inputs.year }}
ENV_VERSION: ${{ github.event.inputs.version }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
token: ${{ secrets.PAT }}
fetch-depth: 0
- uses: actions/setup-node@v3
- uses: actions/setup-node@v4
with:
node-version: 16
node-version: 18
- name: Create new update branch
run: git checkout -b sqlite-update-${{ env.ENV_VERSION }}
- name: Update download script
Expand All @@ -35,7 +35,7 @@ jobs:
- name: Download, compile and package SQLite
run: npm run download
- name: Push update branch
uses: stefanzweifel/git-auto-commit-action@v4
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: Update SQLite to version ${{ env.ENV_TRUE_VERSION }}
branch: sqlite-update-${{ env.ENV_VERSION }}
Expand Down
6 changes: 3 additions & 3 deletions binding.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@
'target_name': 'better_sqlite3',
'dependencies': ['deps/sqlite3.gyp:sqlite3'],
'sources': ['src/better_sqlite3.cpp'],
'cflags_cc': ['-std=c++17'],
'cflags_cc': ['-std=c++20'],
'xcode_settings': {
'OTHER_CPLUSPLUSFLAGS': ['-std=c++17', '-stdlib=libc++'],
'OTHER_CPLUSPLUSFLAGS': ['-std=c++20', '-stdlib=libc++'],
},
'msvs_settings': {
'VCCLCompilerTool': {
'AdditionalOptions': [
'/std:c++17',
'/std:c++20',
],
},
},
Expand Down
11 changes: 8 additions & 3 deletions deps/copy.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,14 @@ if (process.argv[3]) {
}

for (const { filename, optional } of files) {
if (optional && !fs.existsSync(path.join(source, filename))) {
const sourceFilepath = path.join(source, filename);
const destFilepath = path.join(dest, filename);

if (optional && !fs.existsSync(sourceFilepath)) {
continue;
}
fs.accessSync(path.join(source, filename));
fs.copyFileSync(path.join(source, filename), path.join(dest, filename));

fs.accessSync(sourceFilepath);
fs.mkdirSync(path.dirname(destFilepath), { recursive: true });
fs.copyFileSync(sourceFilepath, destFilepath);
}
4 changes: 2 additions & 2 deletions deps/defines.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,14 @@
'HAVE_UINT16_T=1',
'HAVE_UINT32_T=1',
'HAVE_UINT8_T=1',
'HAVE_USLEEP=1',
'SQLITE_DEFAULT_CACHE_SIZE=-16000',
'SQLITE_DEFAULT_FOREIGN_KEYS=1',
'SQLITE_DEFAULT_MEMSTATUS=0',
'SQLITE_DEFAULT_WAL_SYNCHRONOUS=1',
'SQLITE_DQS=0',
'SQLITE_ENABLE_COLUMN_METADATA',
'SQLITE_ENABLE_DBSTAT_VTAB',
'SQLITE_ENABLE_DESERIALIZE',
'SQLITE_ENABLE_FTS3',
'SQLITE_ENABLE_FTS3_PARENTHESIS',
Expand All @@ -26,10 +28,8 @@
'SQLITE_ENABLE_RTREE',
'SQLITE_ENABLE_STAT4',
'SQLITE_ENABLE_UPDATE_DELETE_LIMIT',
'SQLITE_INTROSPECTION_PRAGMAS',
'SQLITE_LIKE_DOESNT_MATCH_BLOBS',
'SQLITE_OMIT_DEPRECATED',
'SQLITE_OMIT_GET_TABLE',
'SQLITE_OMIT_PROGRESS_CALLBACK',
'SQLITE_OMIT_SHARED_CACHE',
'SQLITE_OMIT_TCL_VARIABLE',
Expand Down
17 changes: 13 additions & 4 deletions deps/download.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
# 4. node-gyp links the two resulting binaries to generate better_sqlite3.node.
# ===

YEAR="2023"
VERSION="3410200"
YEAR="2024"
VERSION="3470000"

# Defines below are sorted alphabetically
DEFINES="
Expand All @@ -30,12 +30,14 @@ HAVE_STDINT_H=1
HAVE_UINT16_T=1
HAVE_UINT32_T=1
HAVE_UINT8_T=1
HAVE_USLEEP=1
SQLITE_DEFAULT_CACHE_SIZE=-16000
SQLITE_DEFAULT_FOREIGN_KEYS=1
SQLITE_DEFAULT_MEMSTATUS=0
SQLITE_DEFAULT_WAL_SYNCHRONOUS=1
SQLITE_DQS=0
SQLITE_ENABLE_COLUMN_METADATA
SQLITE_ENABLE_DBSTAT_VTAB
SQLITE_ENABLE_DESERIALIZE
SQLITE_ENABLE_FTS3
SQLITE_ENABLE_FTS3_PARENTHESIS
Expand All @@ -47,10 +49,8 @@ SQLITE_ENABLE_MATH_FUNCTIONS
SQLITE_ENABLE_RTREE
SQLITE_ENABLE_STAT4
SQLITE_ENABLE_UPDATE_DELETE_LIMIT
SQLITE_INTROSPECTION_PRAGMAS
SQLITE_LIKE_DOESNT_MATCH_BLOBS
SQLITE_OMIT_DEPRECATED
SQLITE_OMIT_GET_TABLE
SQLITE_OMIT_PROGRESS_CALLBACK
SQLITE_OMIT_SHARED_CACHE
SQLITE_OMIT_TCL_VARIABLE
Expand Down Expand Up @@ -88,6 +88,15 @@ make sqlite3.c > /dev/null || exit 1
echo "copying amalgamation..."
cp sqlite3.c sqlite3.h sqlite3ext.h "$OUTPUT/" || exit 1

echo "applying patches..."
cd "$DEPS" || exit 1
for patch in patches/*.patch; do
# If a patch fails, just skip it an move on.
# By default `patch` tries to be clever and reverse the patch, so we have to specify `--forward`.
# If the patch fails, we # don't write .orig and .rej files, so we have to specify `--no-backup-if-mismatch` and `--reject-file=-`.
patch --batch --forward --no-backup-if-mismatch --reject-file=- -p2 < "$patch"
done

echo "updating gyp configs..."
GYP="$DEPS/defines.gypi"
printf "# THIS FILE IS AUTOMATICALLY GENERATED BY deps/download.sh (DO NOT EDIT)\n\n{\n 'defines': [\n" > "$GYP"
Expand Down
15 changes: 15 additions & 0 deletions deps/patches/1208.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
diff --git a/deps/sqlite3/sqlite3.c b/deps/sqlite3/sqlite3.c
index b1a807f..38bd1e6 100644
--- a/deps/sqlite3/sqlite3.c
+++ b/deps/sqlite3/sqlite3.c
@@ -24887,8 +24887,8 @@ static const struct {
/* 1 */ { 6, "minute", 7.7379e+12, 60.0 },
/* 2 */ { 4, "hour", 1.2897e+11, 3600.0 },
/* 3 */ { 3, "day", 5373485.0, 86400.0 },
- /* 4 */ { 5, "month", 176546.0, 30.0*86400.0 },
- /* 5 */ { 4, "year", 14713.0, 365.0*86400.0 },
+ /* 4 */ { 5, "month", 176546.0, 2592000.0 },
+ /* 5 */ { 4, "year", 14713.0, 31536000.0 },
};

/*
Loading