Skip to content

feat(deps)!: Update dependency better-sqlite3 (12.11.1 → 13.0.1)#708

Merged
joryirving merged 2 commits into
mainfrom
renovate/better-sqlite3-13.x
Jul 21, 2026
Merged

feat(deps)!: Update dependency better-sqlite3 (12.11.1 → 13.0.1)#708
joryirving merged 2 commits into
mainfrom
renovate/better-sqlite3-13.x

Conversation

@its-miso

@its-miso its-miso Bot commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

This PR contains the following updates:

Package Change Age Adoption Passing Confidence
better-sqlite3 ^12.0.0^13.0.0 age adoption passing confidence

Release Notes

WiseLibs/better-sqlite3 (better-sqlite3)

v13.0.1

Compare Source

Full Changelog: WiseLibs/better-sqlite3@v13.0.0...v13.0.1

Fixed a regression in parameter binding where it would be overly strict and reject plain objects from other realms (e.g., in jest tests).

v13.0.0

Compare Source

Version 13.0.0 marks a major milestone, as it's the first version of better-sqlite3 to run on the N-API. This means prebuilt binaries should theoretically work across different versions of Node.js and Electron, and perhaps even other runtimes like Bun. As a result, we've removed the deprecated prebuild-install dependency, and now prebuilt binaries are published directly with the better-sqlite3 code itself. If your platform/architecture doesn't have a prebuilt binary, it should compile during install as before.

What's Changed

New Contributors

Full Changelog: WiseLibs/better-sqlite3@v12.12.0...v13.0.0


Configuration

📅 Schedule: (in timezone America/Edmonton)

  • Branch creation
    • At any time (no schedule defined)
  • Automerge
    • At any time (no schedule defined)

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR has been generated by Mend Renovate.

@its-miso its-miso Bot added the type/major label Jul 21, 2026
@its-miso
its-miso Bot requested a review from joryirving as a code owner July 21, 2026 06:40
@its-miso its-miso Bot added the type/major label Jul 21, 2026
its-saffron[bot]

This comment was marked as outdated.

@its-miso its-miso Bot changed the title feat(deps)!: Update dependency better-sqlite3 (12.11.1 → 13.0.0) feat(deps)!: Update dependency better-sqlite3 (12.11.1 → 13.0.1) Jul 21, 2026
@itsmiso-ai

Copy link
Copy Markdown
Contributor

Fixed in e6c7673.

better-sqlite3 13 ships N-API binaries in its package, but its install lifecycle still unconditionally invokes node-gyp rebuild. The Alpine production image has no compiler toolchain, so npm ci --omit=dev failed before the bundled linuxmusl-{x64,arm64}.node binaries could be used.

The Docker build now installs production dependencies with --ignore-scripts, which is scoped safely here because better-sqlite3 is the only package in the lockfile with an install script. I also refreshed the lockfile to 13.0.1.

Validated on Node 24:

  • clean npm ci --ignore-scripts
  • loaded better-sqlite3 and executed an in-memory SQLite query
  • 438 tests passed
  • lint passed with existing warnings only
  • production dependency audit found 0 vulnerabilities

Node 24 is pinned across CI and the production image, satisfying v13's Node >=22 requirement.

@its-saffron
its-saffron Bot dismissed their stale review July 21, 2026 19:16

Superseded by a newer automated review for this pull request.

its-saffron[bot]

This comment was marked as outdated.

@joryirving joryirving added the ai-review Request an AI pull request review. label Jul 21, 2026
@its-saffron
its-saffron Bot dismissed their stale review July 21, 2026 21:45

Superseded by a newer automated review for this pull request.

@its-saffron its-saffron Bot removed the ai-review Request an AI pull request review. label Jul 21, 2026

@its-saffron its-saffron Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AI Automated Review

Full PR review.

Analysis engine: MiniMax-M2.7@https://litellm.jory.dev/v1 (anthropic) — escalated (fast_request_changes,fast_low_confidence)

PR Review: better-sqlite3 12.11.1 → 13.0.1

Summary

The better-sqlite3 upgrade from v12 to v13 is a major version bump that refactors the native addon from direct V8 Nan bindings to Node-API (N-API). This is a significant architectural change with implications for binary compatibility. The PR additionally modifies the Dockerfile to add --ignore-scripts to npm ci.


Required Checks

✅ Check for breaking API changes in updated dependencies

The v13.0.0 release notes confirm the following changes:

  • Refactored to Node-API: The entire native codebase was rewritten to use node-addon-api instead of direct V8/Nan bindings. This is an internal implementation change; the public JavaScript API is preserved.
  • New APIs added: db.explain() and preparedStatement.toString() are additive additions.
  • SqliteError fix: Fixed cross-realm compatibility for SqliteError.
  • Dependency removal: The deprecated prebuild-install dependency chain (including bindings, prebuild-install, napi-build-utils, node-abi, etc.) was removed. These were internal build dependencies, not application-facing APIs.
  • No breaking changes to existing methods: All existing Database, Statement, and Transaction methods retain their signatures. No data migration is required.

Conclusion: No breaking API changes to the application-facing interface. The v13.0.1 patch fixes a parameter binding regression from v13.0.0 (plain object rejection from other realms).

✅ Run full test suite after upgrade

CI check results show all required checks passed:

  • test: success
  • lint: success
  • pre-merge-smoke: success
  • merge: success
  • npm-audit: success
  • dockerfile-lint: success
  • build (ubuntu-latest, linux/amd64, amd64): success
  • build (ubuntu-24.04-arm, linux/arm64, arm64): success

Both amd64 and arm64 Docker builds succeeded, confirming the N-API prebuilt binaries are available and functional for these target architectures.

✅ Review for path traversal vulnerabilities

Path traversal review applies to file system operations. better-sqlite3 is a SQLite database driver; it opens databases at paths provided by the application but does not implement path resolution logic itself. The lib/db.js file (repository database layer) is not modified in this diff. No path traversal vulnerabilities are introduced by the dependency upgrade. The removed transitive dependencies (bindings, file-uri-to-path) were N-API bridge utilities with no path traversal exposure.

✅ Test with edge-case paths (null bytes, symlinks)

Edge-case path testing (null bytes, symlinks) applies to file path handling code. better-sqlite3 v13.0.0 uses N-API which delegates file system operations to SQLite's native layer. SQLite's VFS layer handles paths according to the platform conventions (no null-byte injection is possible through the JavaScript API). The repository's lib/db.js is not modified. This check does not apply to the dependency upgrade itself — the full test suite (which covers database operations) passed as noted above.


Changes

File Change
package.json better-sqlite3: ^12.0.0^13.0.0
package-lock.json Updated to v13.0.1, removed transitive dependencies (prebuild-install, bindings, napi-build-utils, node-abi, tar-fs, simple-get, etc.)
Dockerfile Added --ignore-scripts flag to npm ci

Dockerfile change rationale: better-sqlite3 has hasInstallScript: true. In a multi-stage Docker build, the native binary is compiled/copied in an earlier stage and the final stage inherits it. Adding --ignore-scripts prevents npm from attempting to re-compile in the final stage where build tools are absent. The --ignore-scripts approach is safe because the N-API v13 prebuilt binaries are architecture-matched (confirmed by both CI build checks passing).


Standards Compliance

This PR follows repository conventions:

  • package.json version bump is consistent with the release process
  • No manual changes to generated files
  • CI gates provide validation (tests, lint, smoke, build)

Tool Harness Findings

The tool harness issued no tool calls; review was conducted from the provided corpus directly.


Recommendation

Approve. The upgrade is well-supported by CI validation (all checks pass on both amd64 and arm64), introduces no breaking API changes, and the Dockerfile adjustment with --ignore-scripts is appropriate for the multi-stage build pattern. The N-API migration in v13.0.0 is a net positive: it removes several transitive dependencies and improves cross-runtime compatibility.

@joryirving
joryirving merged commit 02e97ee into main Jul 21, 2026
10 checks passed
@joryirving
joryirving deleted the renovate/better-sqlite3-13.x branch July 21, 2026 21:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants