Skip to content

Handle both undefined and null the same way in bind parameters #153

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

Open
kigiri opened this issue Apr 9, 2025 · 0 comments
Open

Handle both undefined and null the same way in bind parameters #153

kigiri opened this issue Apr 9, 2025 · 0 comments

Comments

@kigiri
Copy link

kigiri commented Apr 9, 2025

Right now, sqlite3 throws when we attempt to bind undefined.
Is this on design ? I would expect undefined and null to be handled the same way.

I forked and did a change that seems to modify the behavior, just checking if it's something you would accept a PR for or If i will have to keep my fork in sync.

I simply added:

  case "undefined": {
    // pass
    break;
  }

Here:

sqlite3/src/statement.ts

Lines 300 to 303 in c078d61

}
case "object": {
if (param === null) {
// pass

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant