mysql
mysql copied to clipboard
Variable can't contain backslash
This is an example code.
const text = 'abc\\';
await client.execute('insert into users(name) values(?)', [text]);
This is a result of the query string.
insert into users(name) values("abc\")
So, it will throw an error.
@chitly Thanks chitly, it's a really good issue.
@manyuanrong @zhmushan It should be an escape issue. Since this lib depends on module sql_builder
, I prefer to handle such issue in that module. Thoughts?
I think it needs to be handled in sql_builder, and if the value ends with "", it can be very violent to directly add a "" at the end
I've raised a pull request to fix this in sql-builder https://github.com/manyuanrong/sql-builder/pull/11