sql-template-strings
Advanced tools
Comparing version 1.1.1 to 1.1.2
{ | ||
"name": "sql-template-strings", | ||
"version": "1.1.1", | ||
"version": "1.1.2", | ||
"description": "ES6 tagged template strings for prepared statements with mysql and postgres", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -69,8 +69,3 @@ A simple yet powerful module to allow you to use ES6 tagged template strings for prepared/escaped statements in [mysql](https://www.npmjs.com/package/mysql) / [mysql2](https://www.npmjs.com/package/mysql2) and [postgres](https://www.npmjs.com/package/pq). | ||
// with template strings | ||
let query = SQL`SELECT author FROM books WHERE name = ${book}` | ||
query.name = 'my_query' | ||
pg.query(query) | ||
// or using lodash | ||
pg.query(_.assign(SQL`SELECT author FROM books WHERE name = ${book}`, {name: 'my_query'})) | ||
pg.query(Object.assign(SQL`SELECT author FROM books WHERE name = ${book}`, {name: 'my_query'})) | ||
``` | ||
@@ -77,0 +72,0 @@ |
6897
77