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
Looks like the third parameter is always expected to be the callback, not the on_dupe as above. Using the above signature will lead the query builder to totally ignore the on_dupe parameter.
That is: using the following code: conn.insert_ignore('mytable', {a: 10, b: 100}, 'ON DUPLICATE KEY UPDATE ...', (err, res) => {})
Using the query builder following the documentation leads to an error: the argument list is not used as in the example (https://www.npmjs.com/package/node-querybuilder#insert_ignoretable-dataon_dupe-callback):
.insert_ignore(table, data[,on_dupe][, callback])
Looks like the third parameter is always expected to be the callback, not the on_dupe as above. Using the above signature will lead the query builder to totally ignore the on_dupe parameter.
That is: using the following code:
conn.insert_ignore('mytable', {a: 10, b: 100}, 'ON DUPLICATE KEY UPDATE ...', (err, res) => {})
is wong and won't build the right query.
The following works fine:
conn.insert_ignore('mytable', {a: 10, b: 100}, (err, res) => {}, 'ON DUPLICATE KEY UPDATE ...')
The text was updated successfully, but these errors were encountered: