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

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

Current Tags

  • 1.1.3                                ...           latest (3 years ago)

9 Versions

  • 1.1.3                                ...           3 years ago
  • 1.1.2                                ...           7 years ago
  • 1.1.1                                ...           10 years ago
  • 1.1.0                                ...           11 years ago
  • 1.0.0                                ...           11 years ago
  • 0.1.3                                ...           11 years ago
  • 0.1.2                                ...           11 years ago
  • 0.1.1                                ...           12 years ago
  • 0.1.0                                ...           12 years ago
Maintainers (1)
Downloads
Today 0
This Week 1
This Month 1
Last Day 0
Last Week 0
Last Month 1
Dependencies (1)
Dev Dependencies (2)
Dependents (1)

Copyright 2013 - present © cnpmjs.org | Home |