sqlite: bind undefined to NULL - #65709
Merged
nodejs-github-bot merged 1 commit intoSep 8, 2026
Merged
Conversation
Collaborator
|
Review requested:
|
Omitting a named parameter binds NULL, but passing `undefined` for that same parameter threw ERR_INVALID_ARG_TYPE. Bind `undefined` to NULL so the two forms agree. This matches the conversion already applied to a user-defined function's `undefined` return value, as well as SQLite's own WASM oo1 API. Fixes: nodejs#61824 Refs: nodejs#61472 Refs: nodejs#62008 Co-authored-by: mike-git374 <217764531+mike-git374@users.noreply.github.com> Assisted-by: claude:opus-5 Signed-off-by: Trevor Burnham <trevorburnham@gmail.com>
TrevorBurnham
force-pushed
the
sqlite-bind-undefined-to-null
branch
from
September 1, 2026 15:45
5cb500c to
47bbca8
Compare
TrevorBurnham
marked this pull request as ready for review
September 1, 2026 15:51
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #65709 +/- ##
==========================================
- Coverage 90.07% 90.04% -0.03%
==========================================
Files 754 754
Lines 256395 256395
Branches 48494 48499 +5
==========================================
- Hits 230947 230875 -72
- Misses 16563 16639 +76
+ Partials 8885 8881 -4
🚀 New features to boost your workflow:
|
trivikr
approved these changes
Sep 4, 2026
Collaborator
Collaborator
|
Landed in 41cb09f |
aduh95
pushed a commit
that referenced
this pull request
Sep 16, 2026
Omitting a named parameter binds NULL, but passing `undefined` for that same parameter threw ERR_INVALID_ARG_TYPE. Bind `undefined` to NULL so the two forms agree. This matches the conversion already applied to a user-defined function's `undefined` return value, as well as SQLite's own WASM oo1 API. Fixes: #61824 Refs: #61472 Refs: #62008 Co-authored-by: mike-git374 <217764531+mike-git374@users.noreply.github.com> Assisted-by: claude:opus-5 Signed-off-by: Trevor Burnham <trevorburnham@gmail.com> PR-URL: #65709 Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
mceachen
added a commit
to photostructure/node-sqlite
that referenced
this pull request
Sep 18, 2026
Passing undefined for a parameter threw while omitting the same named parameter bound NULL, so the two forms disagreed. This also forced callers using query builders like Knex, which emit undefined for columns missing from a multi-row insert, to sanitize bindings by hand. Ports nodejs/node#65709.
nodejs-github-bot
added a commit
that referenced
this pull request
Sep 20, 2026
Notable changes: crypto: * (SEMVER-MINOR) add crypto.parsePKCS12() (Brian Muenzenmeyer) #65627 doc: * add araujogui to collaborators (Guilherme Araújo) #66090 ffi: * (SEMVER-MINOR) load libraries from a mounted VFS (Matteo Collina) #65909 fs: * (SEMVER-MINOR) add openAsBlobSync (greenhead) #65644 net: * (SEMVER-MINOR) support sending net.BoundSocket to threads and child processes (Guy Bedford) #64725 perf_hooks: * (SEMVER-MINOR) implement SlidingWindowHistogram (James M Snell) #65825 * (SEMVER-MINOR) implement qrde analysis support in Histogram (James M Snell) #65806 sqlite: * (SEMVER-MINOR) bind undefined to NULL (Trevor Burnham) #65709 src,lib: * (SEMVER-MINOR) add util.markPromiseAsHandled (James M Snell) #65805 test: * (SEMVER-MINOR) expand histogram test coverage (James M Snell) #65825 util: * (SEMVER-MINOR) implement util.throttle (James M Snell) #65899 * (SEMVER-MINOR) implement debounce (James M Snell) #65899 PR-URL: #66163
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #61824
This PR re-implements #62008 by @mike-git374. The one-line behavior change is theirs; this PR adds the documentation and the remaining test coverage.
Omitting a named parameter binds NULL, but passing
undefinedfor that same parameter threwERR_INVALID_ARG_TYPE:Binding
undefinedto NULL makes those agree. It also matchesJSValueToSQLiteResult, which already maps a user-defined function'sundefinedreturn value to NULL, and SQLite's own WASM oo1 API.