mustache-sql

0.1.0 • Public • Published

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

/mustache-sql/

    Package Sidebar

    Install

    npm i mustache-sql

    Weekly Downloads

    4

    Version

    0.1.0

    License

    MIT

    Last publish

    Collaborators

    • hden