You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I expect that the question marks in sql will be replaced with the values from params (as the documentation describes). But the sql is being run with the question marks still there. I'm getting this error:
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '?, TRUE, TRUE, ?, ?, NOW())'
https://github.com/db-migrate/mysql/blob/master/index.js#L375 That function's called from runSql and it's not quite right. It shift the first argument (sql), then pops the last. It blindly expects the last argument to be callback. It should probably check if the last argument is an array and, if so, treat it as params. If I get some time I'll try to fix it and file a PR.
I have some code like this:
I expect that the question marks in
sql
will be replaced with the values fromparams
(as the documentation describes). But the sql is being run with the question marks still there. I'm getting this error:These are the values of id, name, description:
Btw, I'm using promises, not the callback function.
What's strange is if I add a callback function as the third parameter, the placeholders are replaced. This seems like a bug.
If I use this function instead of db.runSql, it works fine:
For example:
Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.
The text was updated successfully, but these errors were encountered: