sidorares / sidorares/node-mysql2

Adding list of undefined parameter names to the 'Bind parameters must not contain undefined' error message

Open
#1,706 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
4.4k
Forks
680
Avg merge
9h 7m
Merged PRs (30d)
59

Description

Currently the error message shown is:
Error: Bind parameters must not contain undefined. To pass SQL NULL specify JS null

I've added some code to list which named parameters are undefined so the error message becomes:
Error: Bind parameters must not contain undefined (:id, :email). To pass SQL NULL specify JS null

Contributing guidelines says it's best to start an issue on changes before creating a PR so thought I'd mention here to see if it's of interest.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The issue names no source file or test; start by locating the parameter-binding path that raises this error and inspect how named parameters are represented there. Done means the error lists the undefined named parameters while preserving the existing SQL NULL guidance, with coverage for the updated message.

Written by the indexing model from the issue text.

Assessment

Tech stack
mysql, node.js, typescript
Domain
backend, databases
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.