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

sql-query

Package Overview
Dependencies
Maintainers
1
Versions
49
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sql-query - npm Package Compare versions

Comparing version 0.1.4 to 0.1.5

test/integration/test-where-exists.js

16

lib/Where.js

@@ -27,9 +27,19 @@ exports.build = function (Dialect, where) {

if (where.e) {
// EXISTS
// EXISTS
wheres = [];
if(Array.isArray(where.e.l[0]) && Array.isArray(where.e.l[1])) {
for (i = 0; i < where.e.l[0].length; i++) {
wheres.push(Dialect.escapeId(where.e.l[0][i]) + " = " + Dialect.escapeId(where.e.tl, where.e.l[1][i]));
}
} else {
wheres.push(Dialect.escapeId(where.e.l[0]) + " = " + Dialect.escapeId(where.e.tl, where.e.l[1]));
}
return [
"EXISTS (" +
"SELECT * FROM " + Dialect.escapeId(where.e.t) + " " +
"WHERE " + Dialect.escapeId(where.e.l[0]) + " = " + Dialect.escapeId(where.e.tl, where.e.l[1]) + " " +
"WHERE " + wheres.join(" AND ") + " " +
"AND " + buildOrGroup(Dialect, { t: null, w: where.w }) +
")"
")"
];

@@ -36,0 +46,0 @@ }

5

package.json

@@ -9,3 +9,3 @@ {

],
"version": "0.1.4",
"version": "0.1.5",
"license": "MIT",

@@ -15,2 +15,5 @@ "repository": {

},
"contributors": [
{ "name" : "Benjamin Pannell", "email" : "admin@sierrasoftworks.com" }
],
"scripts": {

@@ -17,0 +20,0 @@ "test": "make"

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