You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -36,9 +36,9 @@ yarn add @homeofthings/sqlite3
36
36
37
37
### Prebuilt binaries
38
38
39
-
`sqlite3`v5+ was rewritten to use [Node-API](https://nodejs.org/api/n-api.html) so prebuilt binaries do not need to be built for specific Node versions. `sqlite3` currently builds for both Node-API v3 and v6. Check the [Node-API version matrix](https://nodejs.org/api/n-api.html#node-api-version-matrix) to ensure your Node version supports one of these. The prebuilt binaries should be supported on Node v20.17.0+.
39
+
`@homeofthings/sqlite3`uses [Node-API](https://nodejs.org/api/n-api.html) so prebuilt binaries do not need to be built for specific Node versions. Prebuilt binaries are available for Node-API v3 and v6. Check the [Node-API version matrix](https://nodejs.org/api/n-api.html#node-api-version-matrix) to ensure your Node version supports one of these. Requires Node.js v20.17.0 or later.
40
40
41
-
The module uses [`prebuild-install`](https://github.com/prebuild/prebuild-install) to download the prebuilt binary for your platform, if it exists. These binaries are hosted on GitHub Releases for `sqlite3` versions above 5.0.2, and they are hosted on S3 otherwise. The following targets are currently provided:
41
+
The module uses [`prebuild-install`](https://github.com/prebuild/prebuild-install) to download the prebuilt binary for your platform, if it exists. These binaries are hosted on GitHub Releases. The following targets are currently provided:
Copy file name to clipboardExpand all lines: memory-bank/build-system.md
+36-1Lines changed: 36 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -127,7 +127,42 @@ The `NAPI_VERSION` define is set via `napi_build_version` variable in binding.gy
127
127
- For local builds, it's stored in `build/config.gypi` (e.g., `"napi_build_version": "9"`)
128
128
- For prebuilds, the `prebuild` package passes it via `--napi_build_version=<version>` flag
129
129
130
-
**Prebuilt binaries**: Available for NAPI versions 3 and 6 (see `package.json``binary.napi_versions`).
130
+
### NAPI Versions Configuration
131
+
132
+
The `package.json` specifies which NAPI versions to build prebuilt binaries for:
133
+
134
+
```json
135
+
"binary": {
136
+
"napi_versions": [3, 6]
137
+
}
138
+
```
139
+
140
+
**Why multiple versions?**
141
+
142
+
NAPI versions are independent of Node.js versions - they represent API feature tiers, not Node.js version numbers. Each NAPI version adds new capabilities:
NAPI is backward compatible - a binary built for NAPI v3 will run on any Node.js that supports v3 or higher. Since Node.js 20.17.0+ supports NAPI v9, it can run binaries built for v3, v6, or v9.
158
+
159
+
**Code Conditionals**:
160
+
161
+
The source code uses `#if NAPI_VERSION < 6` conditionals in [`src/database.h`](../src/database.h) and [`src/database.cc`](../src/database.cc) to provide backward compatibility for NAPI versions below v6. When building for NAPI v6+, these conditionals are disabled.
162
+
163
+
**Current Configuration Rationale**:
164
+
165
+
The `[3, 6]` configuration is historical from when this fork supported older Node.js versions. Since the project now requires Node.js >= 20.17.0 (which supports NAPI v9), both prebuilt variants work correctly. Future versions could simplify to a single NAPI version (e.g., v6 or v9).
0 commit comments