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

update Better sqlcipher #2

Merged
merged 121 commits into from
Nov 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
121 commits
Select commit Hold shift + click to select a range
5e07181
Add Linux prebuilt binaries for `armv7` and `arm64` and other improve…
m4heshd Apr 7, 2022
d09615c
upgraded to SQLite version 3.38.2, and removed symlinks during build …
JoshuaWise Apr 7, 2022
b544892
attempt at fixing windows CI
JoshuaWise Apr 7, 2022
fbde33b
Add support for electron v18 prebuilds (#790)
jochenschmich-aeberle Apr 7, 2022
7d37224
Add `update-sqlite` workflow (#750)
m4heshd Apr 7, 2022
05da771
replaced github token with PAT in update-sqlite workflow
JoshuaWise Apr 7, 2022
feba6d6
7.5.1
JoshuaWise Apr 7, 2022
bd26a81
sqlcipher support
indutny Apr 2, 2021
3c4a7ee
Merge remote-tracking branch 'upstream/master'
indutny-signal Apr 7, 2022
587721a
deps: add prebuilt OpenSSL-linux-arm64
indutny-signal May 9, 2022
e886811
Add Node `v18` prebuild support
m4heshd May 1, 2022
7aec2ac
Upgrade SQLite to 3.38.5. Update dependencies. (#808)
mceachen May 15, 2022
6da9e56
7.5.2
JoshuaWise May 15, 2022
81fee0a
added code of conduct and contribution rules
JoshuaWise May 16, 2022
9a98290
fixed download script for linux
JoshuaWise May 16, 2022
9cd009b
updated CODEOWNERS
JoshuaWise May 16, 2022
48fdf9a
updated contribution rules
JoshuaWise May 16, 2022
1f58728
updated contribution rules
JoshuaWise May 16, 2022
b1144a8
updated contribution rules
JoshuaWise May 16, 2022
9130cc8
updated contribution rules
JoshuaWise May 16, 2022
a7b1d94
updated contribution rules
JoshuaWise May 16, 2022
223598b
updated contribution rules
JoshuaWise May 16, 2022
c39c7de
updated contribution rules
JoshuaWise May 16, 2022
76ab48f
updated contribution rules
JoshuaWise May 16, 2022
3cb7891
updated contribution rules
JoshuaWise May 16, 2022
55fec9e
updated contribution rules
JoshuaWise May 16, 2022
25e1c11
updated contribution rules
JoshuaWise May 16, 2022
499f748
updated contribution rules
JoshuaWise May 16, 2022
a39e0ac
updated contribution rules
JoshuaWise May 16, 2022
dfbedcc
updated contribution rules
JoshuaWise May 16, 2022
e56fae6
added a workflow for bumping versions
JoshuaWise May 16, 2022
2083409
fixed bump-version workflow
JoshuaWise May 16, 2022
8fd426f
7.5.3
JoshuaWise May 16, 2022
e4a1442
added instructions on creating releases
JoshuaWise May 16, 2022
28667b1
Merge branch 'master' of github.com:JoshuaWise/better-sqlite3
JoshuaWise May 16, 2022
f639d61
Update troubleshooting.md (#752)
thonkinator May 16, 2022
f52b3b0
Update troubleshooting.md (#814)
mceachen May 18, 2022
3c9ac3b
Update SQLite to version 3.39.0 (#828)
JoshuaWise Jun 25, 2022
793c6b2
7.6.0
JoshuaWise Jul 9, 2022
de2b2e9
Update SQLite to version 3.39.1 (#841)
JoshuaWise Jul 13, 2022
e7d1b66
7.6.1
mceachen Jul 13, 2022
157ea8b
Update `prebuild` dependency to v11.0.4 (#845)
m4heshd Jul 15, 2022
4c6a583
Add support for electron `v19` prebuilds (#834)
m4heshd Jul 15, 2022
0c42307
7.6.2
mceachen Jul 15, 2022
65d5e33
Fix electron 20 build errors
indutny-signal Aug 25, 2022
52a3df2
7.5.1
indutny-signal Aug 25, 2022
a92f637
Fix linux builds
indutny-signal Aug 25, 2022
15652ad
Fix virtual table limit offset (#873)
mandel59 Oct 12, 2022
6a4a800
Remove `npm run` from `install` lifecycle script. (#894)
nathanhammond Oct 27, 2022
d66747e
Update SQLite to version 3.39.4 (#896)
JoshuaWise Oct 27, 2022
1cfaa8c
Update sqlcipher to 4.5.2
indutny-signal Nov 4, 2022
dab5761
Optimize build side on macOS
indutny-signal Nov 4, 2022
fc70f3d
Optimize linux build size
indutny-signal Nov 4, 2022
f51f6fe
Revert "Optimize linux build size"
indutny-signal Nov 4, 2022
5caf211
Revert "Optimize build side on macOS"
indutny-signal Nov 4, 2022
c4ab369
Update sqlcipher to support LIMIT in DELETE
indutny-signal Nov 13, 2022
afdbd49
Fix build with Electron 21-x-y
indutny-signal Nov 18, 2022
54e6cba
Please consider setting pragma WAL in your introductory documentation…
StoneCypher Nov 21, 2022
ba9fcec
Support build for electron v20 (#870)
neoxpert Nov 21, 2022
1b32770
Sort defines alphabetically (#878)
threema-danilo Nov 21, 2022
36cf1c4
upgraded to SQLite version 3.40.0
JoshuaWise Nov 21, 2022
dc76c77
8.0.0
JoshuaWise Nov 22, 2022
ae12001
updated recommended Node.js versions in docs
JoshuaWise Nov 22, 2022
b992d04
Add support for electron `v21` prebuilds (#909)
m4heshd Nov 26, 2022
5eab05e
Add support for electron `v22` prebuilds (#915)
m4heshd Dec 2, 2022
f0e622d
Add arm64 prebuilds for macOS (#859)
qier222 Dec 2, 2022
2194095
8.0.1
mceachen Dec 2, 2022
bd45ac7
Move build artifact to CDN
indutny-signal Dec 14, 2022
3a34088
Merge remote-tracking branch 'upstream/master' into better-sqlcipher
indutny-signal Dec 14, 2022
00d21ca
Embed types
indutny-signal Dec 14, 2022
87e3a97
8.0.1-rc.1
indutny-signal Dec 14, 2022
cb49b91
8.0.1
indutny-signal Dec 14, 2022
c821d92
8.0.2
indutny-signal Dec 14, 2022
ce2676e
Fix windows builds
indutny-signal Dec 14, 2022
22ef5d8
8.0.3
indutny-signal Dec 14, 2022
1bf85ef
Fix crashes on Electron 22
indutny-signal Dec 16, 2022
8352176
8.0.4
indutny-signal Dec 16, 2022
7331a93
api: add `setLogHandler`
indutny-signal Jan 18, 2023
ca25048
8.1.0
indutny-signal Jan 18, 2023
6beeec2
deps: slight build optimizations
indutny-signal Jan 18, 2023
5054b50
8.1.1
indutny-signal Jan 18, 2023
a2b01b9
feat: js tokenizer
indutny-signal Jan 25, 2023
3b92255
8.2.0-rc.1
indutny-signal Jan 25, 2023
4830a01
fix minor style issue
indutny-signal Jan 25, 2023
05a8cc2
lib: better tokenizer API
indutny-signal Jan 25, 2023
6d8b420
8.2.0
indutny-signal Jan 25, 2023
dc25527
lib: fix build on windows, better API name
indutny-signal Jan 25, 2023
0807c51
8.2.1
indutny-signal Jan 25, 2023
ac7338a
src: use our custom icu_tokenizer
indutny-signal Jan 26, 2023
0a1cf9c
8.3.0-rc.1
indutny-signal Jan 26, 2023
dbe34b7
deps: fix gyp bug
indutny-signal Jan 26, 2023
56d9872
8.3.0-rc.2
indutny-signal Jan 26, 2023
d4af9a3
test: rename
indutny-signal Jan 26, 2023
5023095
gyp: copy windows lib properly
indutny-signal Jan 26, 2023
211b4bc
8.3.0-rc.3
indutny-signal Jan 26, 2023
ce0f0aa
deps: try different library placement
indutny-signal Jan 26, 2023
bfcdb16
8.3.0-rc.4
indutny-signal Jan 26, 2023
583db4c
8.3.0
indutny-signal Jan 26, 2023
2e432b0
rename tokenizer to signal_tokenizer
indutny-signal Jan 26, 2023
26ae9e0
8.3.1
indutny-signal Jan 26, 2023
d48edee
deps: update tokenizer to 0.2.0
indutny-signal Jan 31, 2023
79ba68c
8.4.0
indutny-signal Jan 31, 2023
f328d9b
deps: add missing libs for the latest rust
indutny-signal Jan 31, 2023
9a92ca8
8.4.1
indutny-signal Jan 31, 2023
0ff0819
deps: update sqlcipher to 4.5.3-fts
indutny-signal Feb 9, 2023
b1df4a4
8.4.2
indutny-signal Feb 9, 2023
fe42144
deps: update tokenizer to 0.2.1
indutny-signal Feb 10, 2023
5ea2450
8.4.3
indutny-signal Feb 10, 2023
23dfe23
deps: update to sqlcipher 4.5.5
indutny-signal Aug 31, 2023
07b5965
8.5.0
indutny-signal Aug 31, 2023
d467d0f
deps: link with ntdll
indutny-signal Aug 31, 2023
f1e1811
8.5.1
indutny-signal Aug 31, 2023
81f37a2
deps: cherry-pick FTS5 fix from upstream
indutny-signal Sep 18, 2023
e8ab1dc
8.5.2
indutny-signal Sep 18, 2023
936295c
Merge remote-tracking branch 'upstream/better-sqlcipher' into better-…
ganthern Nov 13, 2023
a1453b1
update sqlcipher.tar.gz
ganthern Nov 13, 2023
6ebecfa
Added signal-tokenizer builds for x86_64 Windows, macOS & Linux
rezbyte Nov 16, 2023
f46ca55
Include tarball during npm install
rezbyte Nov 17, 2023
393abb9
remove VERSION from tarball
ganthern Nov 17, 2023
b88be61
Add ARM64 binaries of signal-tokenizer to sqlcipher.tar.gz
rezbyte Nov 17, 2023
a3e79dd
add arm64 openssl
ganthern Nov 17, 2023
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
9 changes: 8 additions & 1 deletion .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -1,2 +1,9 @@
* @JoshuaWise
/.github/workflows/build.yml @JoshuaWise @mceachen
/package.json @JoshuaWise @WiseLibs/better-sqlite3-team
/docs/compilation.md @JoshuaWise @WiseLibs/better-sqlite3-team
/docs/performance.md @JoshuaWise @WiseLibs/better-sqlite3-team
/docs/troubleshooting.md @JoshuaWise @WiseLibs/better-sqlite3-team
/deps/sqlite3/sqlite3.c @JoshuaWise @WiseLibs/better-sqlite3-team
/deps/sqlite3/sqlite3.h @JoshuaWise @WiseLibs/better-sqlite3-team
/deps/sqlite3/sqlite3ext.h @JoshuaWise @WiseLibs/better-sqlite3-team
/.github/workflows/build.yml @JoshuaWise @WiseLibs/better-sqlite3-team
57 changes: 41 additions & 16 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,13 @@ jobs:
strategy:
matrix:
os:
- ubuntu-18.04
- ubuntu-20.04
- macos-latest
- windows-latest
- windows-2019
node:
- 10
- 12
- 14
- 16
- 18
name: Testing Node ${{ matrix.node }} on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
steps:
Expand Down Expand Up @@ -58,7 +57,7 @@ jobs:
os:
- ubuntu-18.04
- macos-latest
- windows-latest
- windows-2019
name: Prebuild on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
needs: publish
Expand All @@ -68,10 +67,12 @@ jobs:
with:
node-version: 16
- run: npm install --ignore-scripts
- run: npx --no-install prebuild -r node -t 10.20.0 -t 12.0.0 -t 14.0.0 -t 16.0.0 --include-regex 'better_sqlite3.node$' -u ${{ secrets.GITHUB_TOKEN }}
- run: npx --no-install prebuild -r electron -t 10.0.0 -t 11.0.0 -t 12.0.0 -t 13.0.0 -t 14.0.0 -t 15.0.0 -t 16.0.0 -t 17.0.0 --include-regex 'better_sqlite3.node$' -u ${{ secrets.GITHUB_TOKEN }}
- if: matrix.os == 'windows-latest'
run: npx --no-install prebuild -r electron -t 10.0.0 -t 11.0.0 -t 12.0.0 -t 13.0.0 -t 14.0.0 -t 15.0.0 -t 16.0.0 -t 17.0.0 --include-regex 'better_sqlite3.node$' --arch ia32 -u ${{ secrets.GITHUB_TOKEN }}
- 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 --include-regex 'better_sqlite3.node$' -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 --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 --include-regex 'better_sqlite3.node$' --arch arm64 -u ${{ secrets.GITHUB_TOKEN }}

prebuild-alpine:
name: Prebuild on alpine
Expand All @@ -82,17 +83,41 @@ jobs:
- uses: actions/checkout@v2
- run: apk add build-base git python3 --update-cache
- run: npm install --ignore-scripts
- run: npx --no-install prebuild -r node -t 10.20.0 -t 12.0.0 -t 14.0.0 -t 16.0.0 --include-regex 'better_sqlite3.node$' -u ${{ secrets.GITHUB_TOKEN }}
- 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 }}

prebuild-alpine-arm:
strategy:
matrix:
arch:
- arm/v7
- arm64
name: Prebuild on alpine (${{ matrix.arch }})
runs-on: ubuntu-latest
needs: publish
steps:
- uses: actions/checkout@v2
- uses: docker/setup-qemu-action@v1
- 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 && \
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 }}"

prebuild-arm64-alpine:
name: Prebuild on arm64 alpine
prebuild-linux-arm:
strategy:
matrix:
arch:
- arm/v7
- arm64
name: Prebuild on Linux (${{ matrix.arch }})
runs-on: ubuntu-latest
needs: publish
steps:
- uses: actions/checkout@v2
- uses: docker/setup-qemu-action@v1
- run: |
docker run --rm --entrypoint /bin/sh --platform linux/arm64 node:16-alpine -c "apk add build-base git python3 --update-cache && \
git clone ${{ github.event.repository.clone_url }} && \
cd ${{ github.event.repository.name }} && \
docker run --rm -v $(pwd):/tmp/project --entrypoint /bin/sh --platform linux/${{ matrix.arch }} node:16 -c "\
cd /tmp/project && \
npm install --ignore-scripts && \
npx --no-install prebuild -r node -t 10.20.0 -t 12.0.0 -t 14.0.0 -t 16.0.0 --include-regex 'better_sqlite3.node$' -u ${{ secrets.GITHUB_TOKEN }}"
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 }}"
36 changes: 36 additions & 0 deletions .github/workflows/bump-version.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: bump-version

on:
workflow_dispatch:
inputs:
type:
type: choice
description: Type of version bump
required: true
options:
- patch
- minor
- major

jobs:
bump:
name: Bump to a new version
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
token: ${{ secrets.PAT }}
fetch-depth: 0
- uses: actions/setup-node@v2
with:
node-version: 16
- name: Configure user
run: |
git config --local user.name "${{ github.actor }}"
git config --local user.email "${{ github.actor }}@users.noreply.github.com"
- name: Bump the version
run: npm version ${{ github.event.inputs.type }}
- name: Push commit
run: git push origin master:master
- name: Push tag
run: git push origin --tags
48 changes: 48 additions & 0 deletions .github/workflows/update-sqlite.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: update-sqlite

on:
workflow_dispatch:
inputs:
year:
description: SQLite release year
required: true
version:
description: SQLite version (encoded)
required: true

jobs:
download-and-update:
name: Download and update SQLite
runs-on: ubuntu-latest
env:
ENV_YEAR: ${{ github.event.inputs.year }}
ENV_VERSION: ${{ github.event.inputs.version }}
steps:
- uses: actions/checkout@v2
with:
token: ${{ secrets.PAT }}
fetch-depth: 0
- uses: actions/setup-node@v2
with:
node-version: 16
- name: Create new update branch
run: git checkout -b sqlite-update-${{ env.ENV_VERSION }}
- name: Update download script
run: |
sed -Ei "s/YEAR=\"[0-9]+\"/YEAR=\"${{ env.ENV_YEAR }}\"/g" ./deps/download.sh
sed -Ei "s/VERSION=\"[0-9]+\"/VERSION=\"${{ env.ENV_VERSION }}\"/g" ./deps/download.sh
echo "ENV_TRUE_VERSION=$((10#${ENV_VERSION:0:1})).$((10#${ENV_VERSION:1:2})).$((10#${ENV_VERSION:3:2}))" >> $GITHUB_ENV
- name: Download, compile and package SQLite
run: npm run download
- name: Push update branch
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: Update SQLite to version ${{ env.ENV_TRUE_VERSION }}
branch: sqlite-update-${{ env.ENV_VERSION }}
- name: Create new PR
uses: repo-sync/pull-request@v2
with:
github_token: ${{ secrets.PAT }}
source_branch: sqlite-update-${{ env.ENV_VERSION }}
pr_title: Update SQLite to version ${{ env.ENV_TRUE_VERSION }}
pr_body: This is an automated pull request, updating SQLite to version \`${{ env.ENV_TRUE_VERSION }}\`.
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,9 @@ lib/binding
temp/
TODO
.local

# Downloaded artifact
deps/unverified.tmp
# deps/sqlcipher.tar.gz

.idea
25 changes: 25 additions & 0 deletions ACKNOWLEDGMENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Acknowledgments

## @types/better-sqlite3

MIT License

Copyright (c) Microsoft Corporation.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE
13 changes: 11 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ The fastest and simplest library for SQLite3 in Node.js.
npm install better-sqlite3
```

> You must be using Node.js v10.20.1 or above. Prebuilt binaries are available for [LTS versions](https://nodejs.org/en/about/releases/). If you have trouble installing, check the [troubleshooting guide](./docs/troubleshooting.md).
> You must be using Node.js v14.21.1 or above. Prebuilt binaries are available for [LTS versions](https://nodejs.org/en/about/releases/). If you have trouble installing, check the [troubleshooting guide](./docs/troubleshooting.md).

## Usage

Expand All @@ -43,11 +43,18 @@ const row = db.prepare('SELECT * FROM users WHERE id = ?').get(userId);
console.log(row.firstName, row.lastName, row.email);
```

Though not required, [it is generally important to set the WAL pragma for performance reasons](https://github.com/WiseLibs/better-sqlite3/blob/master/docs/performance.md).

```js
db.pragma('journal_mode = WAL');
```

##### In ES6 module notation:

```js
import Database from 'better-sqlite3';
const db = new Database('foobar.db', options);
db.pragma('journal_mode = WAL');
```

## Why should I use this instead of [node-sqlite3](https://github.com/mapbox/node-sqlite3)?
Expand Down Expand Up @@ -76,7 +83,9 @@ For these situations, you should probably use a full-fledged RDBMS such as [Post
- [64-bit integer support](./docs/integer.md)
- [Worker thread support](./docs/threads.md)
- [Unsafe mode (advanced)](./docs/unsafe.md)
- [SQLite3 compilation](./docs/compilation.md)
- [SQLite3 compilation (advanced)](./docs/compilation.md)
- [Contribution rules](./docs/contribution.md)
- [Code of conduct](./docs/conduct.md)

# License

Expand Down
12 changes: 7 additions & 5 deletions binding.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,16 @@
'dependencies': ['deps/sqlite3.gyp:sqlite3'],
'sources': ['src/better_sqlite3.cpp'],
'cflags_cc': ['-std=c++17'],
'msvs-settings': {
'VCCLCompilerTool': {
'AdditionalOptions': ['-std:c++17']
}
},
'xcode_settings': {
'OTHER_CPLUSPLUSFLAGS': ['-std=c++17', '-stdlib=libc++'],
},
'msvs_settings': {
'VCCLCompilerTool': {
'AdditionalOptions': [
'/std:c++17',
],
},
},
'conditions': [
['OS=="linux"', {
'ldflags': [
Expand Down
9 changes: 9 additions & 0 deletions deps/common.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,15 @@
},
},
'conditions': [
['target_arch == "x64"', {
'variables': {
'rust_arch%': 'x86_64',
}
}, {
'variables': {
'rust_arch%': 'aarch64',
}
}],
['OS == "win"', {
'defines': ['WIN32'],
'variables': {
Expand Down
26 changes: 26 additions & 0 deletions deps/copy.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
'use strict';
const path = require('path');
const fs = require('fs');

const dest = process.argv[2];
const source = path.resolve(path.sep, process.argv[3] || path.join(__dirname, 'sqlite3'));
const files = [
{ filename: 'sqlite3.c', optional: false },
{ filename: 'sqlite3.h', optional: false },
];

if (process.argv[3]) {
// Support "_HAVE_SQLITE_CONFIG_H" in custom builds.
files.push({ filename: 'config.h', optional: true });
} else {
// Required for some tests.
files.push({ filename: 'sqlite3ext.h', optional: false });
}

for (const { filename, optional } of files) {
if (optional && !fs.existsSync(path.join(source, filename))) {
continue;
}
fs.accessSync(path.join(source, filename));
fs.copyFileSync(path.join(source, filename), path.join(dest, filename));
}
6 changes: 4 additions & 2 deletions deps/defines.gypi
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
# THIS FILE IS AUTOMATICALLY GENERATED (DO NOT EDIT)

{
'defines': [
'SQLITE_LIKE_DOESNT_MATCH_BLOBS',
'SQLITE_THREADSAFE=2',
'SQLITE_USE_URI=0',
'SQLITE_DEFAULT_MEMSTATUS=0',
'SQLITE_OMIT_AUTOINIT',
'SQLITE_OMIT_DEPRECATED',
'SQLITE_OMIT_GET_TABLE',
'SQLITE_OMIT_TCL_VARIABLE',
Expand All @@ -15,6 +14,7 @@
'SQLITE_DEFAULT_CACHE_SIZE=-16000',
'SQLITE_DEFAULT_FOREIGN_KEYS=1',
'SQLITE_DEFAULT_WAL_SYNCHRONOUS=1',
'SQLITE_DQS=0',
'SQLITE_ENABLE_MATH_FUNCTIONS',
'SQLITE_ENABLE_DESERIALIZE',
'SQLITE_ENABLE_COLUMN_METADATA',
Expand All @@ -30,6 +30,8 @@
'HAVE_INT16_T=1',
'HAVE_INT32_T=1',
'HAVE_UINT8_T=1',
'HAVE_INT8_T=1',
'HAVE_STDINT_H=1',
'HAVE_UINT16_T=1',
'HAVE_UINT32_T=1',

Expand Down
Loading