CiscoTool_v1/netmiko_Api/node_modules/named-placeholders
Joseph Le a3b6695f97 first update 2023-09-20 05:57:50 +00:00
..
node_modules/lru-cache first update 2023-09-20 05:57:50 +00:00
LICENSE first update 2023-09-20 05:57:50 +00:00
README.md first update 2023-09-20 05:57:50 +00:00
index.js first update 2023-09-20 05:57:50 +00:00
package.json first update 2023-09-20 05:57:50 +00:00

README.md

Flattr this git repo

NPM

CI

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