postgresql-tag

0.1.0 • Public • Published

pg-sql-tag

Use ES6 tagged template string to generate query objects which can be escaped by node-postgres.

Status

npm version

Installation

Install the package via npm:

$ npm install postgresql-tag

Usage

import pgsql from 'pgsql-tag';
 
const email = readEmailFromUntrustedInput();
 
// email will be escaped
pg.query(pgsql`SELECT name FROM users WHERE email=${email}`, (err, res) => ...);

License

MIT Clément Fiorio <clement.fiorio@gmail.com>

Contributors

Elie Rotenberg

Package Sidebar

Install

npm i postgresql-tag

Weekly Downloads

2

Version

0.1.0

License

MIT

Last publish

Collaborators

  • elie.rotenberg