vendredi 6 mars 2015

mapbox's node sqlite3 - using LIKE with parameterization correctly

So I spent more time than I'd like to disclose finding out this little bit of undocumented gem:


So when you're doing something like: db.all(sql,params,callback)


this wont work


where params and sql is something like:



var params = { $param1 : 'some string' };
var sql = 'select * from FOO where FOO.name LIKE "%$param1%"';


Answered below.


Aucun commentaire:

Enregistrer un commentaire