Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

sql-template-strings

Package Overview
Dependencies
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sql-template-strings - npm Package Compare versions

Comparing version 2.0.2 to 2.0.3

index.d.ts

13

index.js

@@ -19,7 +19,2 @@ 'use strict'

/** Returns the SQL Statement for mysql */
get sql() {
return this.strings.join('?')
}
/**

@@ -50,2 +45,10 @@ * @param {SQLStatement|string} statement

/** Returns the SQL Statement for mysql */
Object.defineProperty(SQLStatement.prototype, 'sql', {
enumerable: true,
get() {
return this.strings.join('?')
}
})
/**

@@ -52,0 +55,0 @@ * @param {string[]} strings

{
"name": "sql-template-strings",
"version": "2.0.2",
"version": "2.0.3",
"description": "ES6 tagged template strings for prepared statements with mysql and postgres",
"main": "index.js",
"typings": "index.d.ts",
"engines": {

@@ -7,0 +8,0 @@ "node": ">4.0.0"

@@ -7,3 +7,3 @@ [![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/pq).
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).

@@ -10,0 +10,0 @@ Example for escaping queries (callbacks omitted):

@@ -31,2 +31,12 @@ 'use strict'

it('should expose "sql" as an enumerable property', () => {
const query = SQL`SELECT * FROM table`
for (const key in query) {
if (key === 'sql') {
return
}
}
throw new assert.AssertionError({message: 'expected enumerable property "sql"'})
})
describe('append()', () => {

@@ -58,3 +68,3 @@

describe('setName()', () => {
it('should set the name and return this', () => {

@@ -61,0 +71,0 @@ assert.equal(SQL`SELECT * FROM table`.setName('my_query').name, 'my_query')

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc