Emmanuil c2e0590820 31.07.2020 4 éve
..
node_modules c2e0590820 31.07.2020 4 éve
Changelog.md c2e0590820 31.07.2020 4 éve
LICENSE c2e0590820 31.07.2020 4 éve
README.md c2e0590820 31.07.2020 4 éve
index.js c2e0590820 31.07.2020 4 éve
package.json c2e0590820 31.07.2020 4 éve

README.md

Flattr this git repo

NPM

Build Status

named-placeholders

compiles "select foo where foo.id = :bar and foo.baz < :baz" into "select foo where foo.id = ? and foo.baz < ?" + ["bar", "baz"]

usage

npm install named-placeholders

see this mysql2 discussion

var mysql = require('mysql');
var toUnnamed = require('named-placeholders')();

var q = toUnnamed('select 1+:test', { test: 123});
mysql.createConnection().query(q[0], q[1]);

credits

parser is based on @mscdex code of his excellent node-mariasql library