Emmanuil c2e0590820 31.07.2020 | %!s(int64=4) %!d(string=hai) anos | |
---|---|---|
.. | ||
node_modules | %!s(int64=4) %!d(string=hai) anos | |
Changelog.md | %!s(int64=4) %!d(string=hai) anos | |
LICENSE | %!s(int64=4) %!d(string=hai) anos | |
README.md | %!s(int64=4) %!d(string=hai) anos | |
index.js | %!s(int64=4) %!d(string=hai) anos | |
package.json | %!s(int64=4) %!d(string=hai) anos |
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