Emmanuil 73a9f0ffcf 20.07.2020 | пре 4 година | |
---|---|---|
.. | ||
node_modules | пре 4 година | |
Changelog.md | пре 4 година | |
LICENSE | пре 4 година | |
README.md | пре 4 година | |
index.js | пре 4 година | |
package.json | пре 4 година |
compiles "select foo where foo.id = :bar and foo.baz < :baz" into "select foo where foo.id = ? and foo.baz < ?" + ["bar", "baz"]
npm install named-placeholders
var mysql = require('mysql');
var toUnnamed = require('named-placeholders')();
var q = toUnnamed('select 1+:test', { test: 123});
mysql.createConnection().query(q[0], q[1]);
parser is based on @mscdex code of his excellent node-mariasql library