chensenlai 10988628a0 语音房项目初始化 | лет назад: 5 | |
---|---|---|
.. | ||
node_modules | лет назад: 5 | |
test | лет назад: 5 | |
.npmignore | лет назад: 5 | |
.travis.yml | лет назад: 5 | |
LICENSE | лет назад: 5 | |
README.md | лет назад: 5 | |
index.js | лет назад: 5 | |
package.json | лет назад: 5 |
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