chensenlai 10988628a0 语音房项目初始化 | il y a 5 ans | |
---|---|---|
.. | ||
node_modules | il y a 5 ans | |
test | il y a 5 ans | |
.npmignore | il y a 5 ans | |
.travis.yml | il y a 5 ans | |
LICENSE | il y a 5 ans | |
README.md | il y a 5 ans | |
index.js | il y a 5 ans | |
package.json | il y a 5 ans |
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});
mysl.createConnection().query(q[0], q[1]);
parser is based on @mscdex code of his excellent node-mariasql library