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.2 to 0.1.3

test/integration/test-where-custom-types.js

28

lib/Dialects/mysql.js

@@ -0,1 +1,3 @@

var util = require("util");
exports.escapeId = function () {

@@ -21,13 +23,2 @@ return Array.prototype.slice.apply(arguments).map(function (el) {

switch (typeof val) {
case 'boolean':
return (val) ? 'true' : 'false';
case 'number':
return val + '';
}
if (val instanceof Date) {
val = dateToString(val, timeZone || "Z");
}
if (Buffer.isBuffer(val)) {

@@ -41,4 +32,15 @@ return bufferToString(val);

if (typeof val === 'object') {
return objectToValues(val, timeZone || "Z");
if (util.isDate(val)) {
val = dateToString(val, timeZone || "Z");
} else {
switch (typeof val) {
case 'boolean':
return (val) ? 'true' : 'false';
case 'number':
return val + '';
case "object":
return objectToValues(val, timeZone || "Z");
case "function":
return val(exports);
}
}

@@ -45,0 +47,0 @@

@@ -29,8 +29,11 @@ var util = require("util");

}
if (util.isDate(val)) {
return "'" + JSON.stringify(val).substr(1, 24) + "'";
}
if (Buffer.isBuffer(val)) {
return "'\\x" + val.toString("hex") + "'";
}
switch (typeof val) {

@@ -41,2 +44,4 @@ case "number":

return val ? "true" : "false";
case "function":
return val(exports);
}

@@ -43,0 +48,0 @@ // No need to escape backslashes with default PostgreSQL 9.1+ config.

@@ -16,8 +16,11 @@ var util = require("util");

}
if (util.isDate(val)) {
return "'" + JSON.stringify(val).substr(1, 24) + "'";
}
if (Buffer.isBuffer(val)) {
return "X'" + val.toString("hex") + "'";
}
switch (typeof val) {

@@ -28,3 +31,6 @@ case "number":

return val ? "true" : "false";
case "function":
return val(exports);
}
// No need to escape backslashes with default PostgreSQL 9.1+ config.

@@ -31,0 +37,0 @@ // Google 'postgresql standard_conforming_strings' for details.

@@ -221,2 +221,7 @@ var Where = require("./Where");

if (typeof sql.from[i].select[j] == "function") {
tmp.push(sql.from[i].select[j](Dialect));
continue;
}
if (!sql.from[i].select[j].f) continue;

@@ -223,0 +228,0 @@

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

],
"version": "0.1.2",
"version": "0.1.3",
"license": "MIT",

@@ -12,0 +12,0 @@ "repository": {

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