-
-
Notifications
You must be signed in to change notification settings - Fork 623
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
More verbose undefined parameter error messages #1707
base: master
Are you sure you want to change the base?
Conversation
Adds list of undefined named parameters/indexes to error message
ref #1706 |
I can't remember if var post = {id: 1, title: 'Hello MySQL'};
// you can do post as well as [post]
var query = connection.query('INSERT INTO posts SET ?', post, function (error, results, fields) {
if (error) throw error;
// Neat!
}); |
was only using for my convenience, probably better to just remove
I wasn't aware of that, I'll try out some tests and see how I can handle it. |
Doesn't look like execute allows that, I get this error when I attempt it: Bind parameters must be array if namedPlaceholders parameter is not enabled. Interestingly if I do |
one of the unit tests never finishes with your changes, could you try running tests locally? |
Apologies for that, I've put a fix in for that issue and it no longer hangs on test-execute-bind-functions. I'm not able to get a clean run on a full test run but I think that's down to me running a real old version of mysql (5.6.45). I'll see if I can get a more up to date version if there are any further issues. |
Adds list of undefined named parameters/indexes to error message.
For named parameters the error message will be
Bind parameters must not contain undefined (parameters :id, :email). To pass SQL NULL specify JS null
and for array parameters it will be
Bind parameters must not contain undefined (indexes 0, 1). To pass SQL NULL specify JS null