0.1.0 • Published 9 years ago

mustache-sql v0.1.0

Weekly downloads
1
License
MIT
Repository
github
Last release
9 years ago

mustache-sql Build Status

hipster-style SQL template

install

npm install --save mustache-sql

example

let render = require('mustache-sql')
let template = 'UPDATE foobar SET {{property}} WHERE id = {{id}}'
let parameter = { id: 1, property: { foo: 'bar', num: 3.14 } }
render(template, parameter)
// UPDATE foobar SET `foo` = 'bar', `num` = 3.14 WHERE id = 1

features

  • {{valu}} and {{{key}}} are escaped by node-mysql
  • partials