Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 2 additions & 0 deletions .clangd
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
CompileFlags:
CompilationDatabase: build/Debug
65 changes: 33 additions & 32 deletions .github/workflows/ci.yaml → .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -1,88 +1,89 @@
---
name: Continuous Integration
name: Build
on:
pull_request: {}
push:
tags:
- "*"
env:
NODE_VERSION: 12.17.0
jobs:
build:
strategy:
matrix:
os:
- macos-10.15
- ubuntu-20.04
- windows-2019
- macos-13
- macos-15
- ubuntu-24.04
- windows-2025
name: "Build ${{ matrix.os }}"
runs-on: "${{ matrix.os }}"
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4.3.0
with:
submodules: true
- name: Prepare node.js
uses: actions/setup-node@v2
uses: actions/setup-node@v4.4.0
with:
node-version: "${{ env.NODE_VERSION }}"
- name: Install dependencies and compile local build
run: npm ci
node-version-file: .nvmrc
# Don't compile anything yet, prebuild will do a clean rebuild anyway so
# compiling anything here is just a waste of time.
- name: Install dependencies only
run: npm ci --ignore-scripts
- name: Check source code formatting
run: npm run chkfmt
- name: Test local build
run: npm test
- name: Compile prebuild
- name: Compile native code as a prebuild
run: npm run prebuild
- name: Test prebuild
- name: Run tests
run: npm test
env:
PREBUILDS_ONLY: "1"
- name: Emit artifact
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4.6.2
with:
name: "prebuild-${{ matrix.os }}"
path: prebuilds

publish:
name: Publish release
needs: build
runs-on: ubuntu-20.04
if: "${{ startsWith(github.ref, 'refs/tags/') }}"
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4.3.0
with:
submodules: true
- name: Prepare node.js
uses: actions/setup-node@v2
uses: actions/setup-node@v4.4.0
with:
node-version: "${{ env.NODE_VERSION }}"
node-version-file: .nvmrc
registry-url: "https://registry.npmjs.org"
# Skip install scripts so that we do not needlessly compile native code
- name: Install dependencies
run: npm ci --ignore-scripts
- name: Pull Darwin artifact
uses: actions/download-artifact@v2
- name: Pull Darwin x86 artifact
uses: actions/download-artifact@v5.0.0
with:
name: prebuild-macos-13
path: prebuilds
- name: Pull Darwin ARM64 artifact
uses: actions/download-artifact@v5.0.0
with:
name: prebuild-macos-10.15
name: prebuild-macos-15
path: prebuilds
- name: Pull Linux artifact
uses: actions/download-artifact@v2
uses: actions/download-artifact@v5.0.0
with:
name: prebuild-ubuntu-20.04
name: prebuild-ubuntu-24.04
path: prebuilds
- name: Pull Windows artifact
uses: actions/download-artifact@v2
uses: actions/download-artifact@v5.0.0
with:
name: prebuild-windows-2019
name: prebuild-windows-2025
path: prebuilds
- name: Build API documentation
run: npm run docs
- name: Publish API documentation
uses: peaceiris/actions-gh-pages@v3
uses: peaceiris/actions-gh-pages@4f9cc6602d3f66b9c108549d475ec49e8ef4d45e # v4.0.0
with:
github_token: "${{ secrets.GITHUB_TOKEN }}"
github_token: "${{ github.token }}"
commit_message: "${{ github.event.head_commit.message }}"
publish_dir: ./docs
- name: Publish to NPM
Expand Down
31 changes: 31 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Test
on:
pull_request: {}
jobs:
build:
strategy:
matrix:
os:
- macos-13
- macos-15
- ubuntu-24.04
- windows-2025
name: "Build ${{ matrix.os }}"
runs-on: "${{ matrix.os }}"
steps:
- name: Checkout
uses: actions/checkout@v4.3.0
with:
submodules: true
- name: Prepare node.js
uses: actions/setup-node@v4.4.0
with:
node-version-file: .nvmrc
- name: Install dependencies and compile
run: npm ci
- name: Check source code formatting
run: npm run chkfmt
- name: Run tests
run: npm test
- name: Build documentation
run: npm run docs
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[submodule "native/sqlite"]
path = native/sqlite
url = https://github.com/azadkuh/sqlite-amalgamation
url = https://github.com/rhuijben/sqlite-amalgamation
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
v22.18.0
17 changes: 0 additions & 17 deletions .vscode/c_cpp_properties.json

This file was deleted.

2 changes: 1 addition & 1 deletion .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"recommendations": [
"esbenp.prettier-vscode",
"ms-vscode.cpptools",
"llvm-vs-code-extensions.vscode-clangd",
"xaver.clang-format"
]
}
58 changes: 45 additions & 13 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,39 +1,71 @@
# v2.4.0
# Changelog

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to
[Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

### Changed

- Adopt keepachangelog.com CHANGELOG format
- Update SQLite to v3.50.3

## [2.4.0] - 2022-01-15

### Changed

- Update SQLite to v3.37.1
- Update node-gyp dependency to v6.1.0
- Apply npm audit

# v2.3.1
## [2.3.1] - 2021-09-06

### Changed

- Add release checklist to PR template
- Update SQLite version number in README

# v2.3.0
## [2.3.0] - 2021-09-06

### Changed

- Update SQLite to v3.36.0
- Apply dev dependency updates from npm audit

# v2.2.0
## [2.2.0] - 2021-03-07

### Changed

- Update SQLite to v3.34.1
- Build for NAPI v6
- Set up GitHub Actions pipeline
- Update some dev dependencies to silence npm audit warnings
- Minor documentation updates

# v2.1.0
## [2.1.0] - 2020-05-23

### Changed

- Update SQLite to v3.31.1

### Fixed

- Fix INTERNALS.md link in README

# v2.0.0
## [2.0.0] - 2020-01-05

### Changed

- Return SQLite extended error codes in `code` property of thrown exceptions
- This is an API-breaking change
- Test suite enhancements
- Bug fixes

# v1.0.0
### Fixed

- Fix diagnostics returned by `Database.prepare()`
- Check for closed database handles in various methods
- Handle statement reset failure more gracefully

## [1.0.0] - 2019-12-28

### Added

- Initial release
44 changes: 15 additions & 29 deletions INTERNALS.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,7 @@ environment can be set up as follows:
$ git submodule init
$ git submodule update
```
2. Run `npm install` to download dependencies.
3. Run `npx node-gyp configure` to prepare a native-code build environment.
4. Run `npx node-gyp build` to force local compilation of the native code. You
2. Run `npm install` to download dependencies and compile the native code. You
will need to have the following development tools installed on your local
machine:
- Python 3 (for `node-gyp`)
Expand All @@ -33,35 +31,23 @@ environment can be set up as follows:
- On macOS:
- The XCode Command Line Tools, which can be installed by typing
`xcode-select --install` at a command-line prompt.
5. Run `npm test` to run the test suite and confirm that your build works
3. Run `npm test` to run the test suite and confirm that your build works
correctly.
6. Run `npm run headers` to download our target version of the Node.js SDK to
`node-gyp`'s cache. This cache is located in your home directory, so you
should only need to do this once.
7. Open your Git checkout in Visual Studio Code and accept all of the workspace
4. Run `npm run clangd` to generate a `compile_commands.json` in the
`build/Debug` subdirectory. clangd uses the contents of this file to provide
accurate contextual assistance and live error messages from within Visual
Studio Code or any other text editor with a clangd LSP integration. You will
need to re-run this command if the `build` subdirectory gets deleted or
recreated, or if the contents of `binding.gyp` change.
5. Open your Git checkout in Visual Studio Code and accept all of the workspace
extension recommendations.

This project currently uses version 12.17.0 of the Node.js SDK for Visual Studio
Code's C/C++ code completion. This is the earliest version of NodeJS' 12.x
series releases that supports an `NAPI_VERSION` of 6 or greater, which we
require for bigint support. Earlier versions of the 12.x series support the
BigInt entry points in their current form, however this API had not yet been
declared stable in those releases.

`node-gyp-build` will download and compile against the SDK version that
corresponds to your local machine's global Node.js installation (or your
currently-selected environment in `nvm`, if applicable). This build may be built
explicitly, or it may automatically execute at `npm install` time in the event
that this package is installed on an OS and processor combination for which no
pre-built binary is available.

The npm `prebuild` script can also be used to create a prebuild for the current
OS and processor. Prebuilds for several architectures are included in each npm
release and relieve most users of the need to compile this module's native code
for their local environment. Prebuilds are configured target a specific version
of NodeJS, and are usually built as part of the CI pipeline that prepares new
releases for upload to npm. It should not normally be necessary to compile a
prebuild manually.
The npm `prebuild` script is used to create a prebuild for the current OS and
processor. Prebuilds for several architectures are included in each npm release
and relieve most users of the need to compile this module's native code for
their local environment. Prebuilds are usually built as part of the CI pipeline
that prepares new releases for upload to npm. It should not normally be
necessary to compile a prebuild manually.

Consult the [prebuildify](https://github.com/prebuild/prebuildify) project's
website for more information about the prebuild mechanism.
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Synchronous N-API interface to SQLite.

The version of SQLite currently bundled with this extension is 3.37.1.
The version of SQLite currently bundled with this extension is 3.50.3.

# Features

Expand Down
2 changes: 1 addition & 1 deletion native/sqlite
Submodule sqlite updated 9 files
+37 −0 .github/workflows/cmake.yml
+536 −101 CMakeLists.txt
+18 −16 README.md
+22,246 −11,094 shell.c
+42,141 −16,717 sqlite3.c
+1,662 −379 sqlite3.h
+13 −0 sqlite3.pc.in
+3 −2 sqlite3_config.h.in
+50 −2 sqlite3ext.h
Loading
Loading