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 85 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
85 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
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
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
94 changes: 65 additions & 29 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,81 +12,116 @@ 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 --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 --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 --include-regex 'better_sqlite3.node$'

jobs:
test:
strategy:
matrix:
os:
- ubuntu-20.04
- macos-latest
- macos-14
- windows-2019
node:
- 14
- 16
- 18
- 19
- 20
- 22
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
- 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
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:
strategy:
fail-fast: false
matrix:
os:
- ubuntu-20.04
- macos-latest
- macos-14
- windows-2019
name: Prebuild on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
needs: publish
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
- 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:
strategy:
fail-fast: false
name: Prebuild on alpine
runs-on: ubuntu-latest
container: node:16-alpine
container: node:18-alpine
needs: publish
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:
strategy:
fail-fast: false
matrix:
arch:
- arm/v7
Expand All @@ -95,17 +130,18 @@ jobs:
runs-on: ubuntu-latest
needs: publish
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:
strategy:
fail-fast: false
matrix:
arch:
- arm/v7
Expand All @@ -114,10 +150,10 @@ jobs:
runs-on: ubuntu-latest
needs: publish
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 -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
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);
}
3 changes: 1 addition & 2 deletions deps/defines.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
'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',
Expand All @@ -26,10 +27,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
7 changes: 3 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="3460000"

# Defines below are sorted alphabetically
DEFINES="
Expand All @@ -30,6 +30,7 @@ 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
Expand All @@ -47,10 +48,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