named-placeholders
sql named placeholders to unnamed compiler
Last updated a year ago by sidorares .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ npm install named-placeholders 
SYNC missed versions from official npm registry.

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

Current Tags

  • 1.1.6                                ...           latest (a year ago)

11 Versions

  • 1.1.6                                ...           a year ago
  • 1.1.4                                ...           a year ago
  • 1.1.3                                ...           4 years ago
  • 1.1.2                                ...           8 years ago
  • 1.1.1                                ...           11 years ago
  • 1.1.0                                ...           11 years ago
  • 1.0.0                                ...           11 years ago
  • 0.1.3                                ...           12 years ago
  • 0.1.2                                ...           12 years ago
  • 0.1.1                                ...           12 years ago
  • 0.1.0                                ...           12 years ago
Maintainers (1)
Downloads
Total 32
Today 0
This Week 0
This Month 13
Last Day 0
Last Week 0
Last Month 10
Dependencies (1)
Dev Dependencies (2)
Dependents (1)

© 2010 - cnpmjs.org x YWFE | Home | YWFE