sql-template-strings
Advanced tools
Comparing version 2.0.4 to 2.1.0
@@ -5,3 +5,3 @@ { | ||
{ | ||
"name": "Launch", | ||
"name": "Mocha", | ||
"type": "node", | ||
@@ -19,3 +19,3 @@ "request": "launch", | ||
"env": { | ||
"NODE_ENV": "development" | ||
"NODE_ENV": "testing" | ||
}, | ||
@@ -39,2 +39,2 @@ "externalConsole": false, | ||
] | ||
} | ||
} |
@@ -12,2 +12,7 @@ | ||
/** | ||
* The SQL Statement for [Sequelize](https://www.npmjs.com/package/sequelize) | ||
*/ | ||
query: string | ||
/** | ||
* The SQL Statement for [mysql](https://www.npmjs.com/package/mysql) | ||
@@ -14,0 +19,0 @@ */ |
@@ -14,2 +14,7 @@ 'use strict' | ||
/** Returns the SQL Statement for Sequelize */ | ||
get query() { | ||
return this.sql | ||
} | ||
/** Returns the SQL Statement for node-postgres */ | ||
@@ -16,0 +21,0 @@ get text() { |
{ | ||
"name": "sql-template-strings", | ||
"version": "2.0.4", | ||
"version": "2.1.0", | ||
"description": "ES6 tagged template strings for prepared statements with mysql and postgres", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -9,3 +9,4 @@ [![Version](https://img.shields.io/npm/v/sql-template-strings.svg?maxAge=2592000)](https://www.npmjs.com/package/sql-template-strings) | ||
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/pg). | ||
A simple yet powerful module to allow you to use ES6 tagged template strings for prepared/escaped statements. | ||
Works with [mysql](https://www.npmjs.com/package/mysql), [mysql2](https://www.npmjs.com/package/mysql2), [postgres](https://www.npmjs.com/package/pg) and [sequelize](https://www.npmjs.com/package/sequelize). | ||
@@ -12,0 +13,0 @@ Example for escaping queries (callbacks omitted): |
@@ -41,2 +41,8 @@ 'use strict' | ||
it('should return the same as sql for query for sequelize', () => { | ||
const value = 123 | ||
const statement = SQL`SELECT * FROM table WHERE column = ${value}` | ||
assert.equal(statement.query, statement.sql) | ||
}) | ||
describe('append()', () => { | ||
@@ -43,0 +49,0 @@ |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
16197
14
293
114