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
Hello. I just started using node.js and your mysql module is very helpful. I like the query values feature but I cannot use it if I have functions and variables in the query. Why not implement an extra class which will be not escaped?
escape(/*...*/){if(valueinstanceofMysqlFunc){returnvalue.toString();}else{//... as usual}}letsql='INSERT INTO user SET ?';letuser={name: 'Alex',created: connection.mysqlFunc('now()')};connection.query(sql,user,(err,result)=>{//...});
The text was updated successfully, but these errors were encountered:
This is something I already thought of. sqlstring module could, instead of ignoring functions, just call them (perhaps passing connection handler) and synchronously replace function return string. Although your example is not actually useful (since you can define a date as current timestamp by default) there are many useful functions one could use, not just for insert statements.
Hello. I just started using node.js and your mysql module is very helpful. I like the query values feature but I cannot use it if I have functions and variables in the query. Why not implement an extra class which will be not escaped?
The text was updated successfully, but these errors were encountered: