Escape A String In Node Js To Insert It In A Sqlite3 Database
I'm using the external module sqlite3 to write and read my db. I want to store a very large description in my db which can contains some particular character. How can I correctly e
Solution 1:
As with any DB API in whatever language, the first rule is to never concatenate strings to build the queries by escaping the inputs but to let the driver do the escaping:
db.run("INSERT INTO mytable VALUES (?)", myBigUnescapedString);
Post a Comment for "Escape A String In Node Js To Insert It In A Sqlite3 Database"