Files
fibonacci-fold/server/node_modules/named-placeholders
Christian Medina d0e8d36c33
Some checks failed
Deploy to Firebase Hosting on merge / build_and_deploy (push) Has been cancelled
latest changes before server transfer
2025-08-05 15:42:36 -04:00
..
2025-08-05 15:42:36 -04:00
2025-08-05 15:42:36 -04:00

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