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.0 to 0.1.1

31

lib/Dialects/sqlite.js

@@ -0,2 +1,31 @@

var util = require("util");
exports.escapeId = require("./mysql").escapeId;
exports.escapeVal = require("./postgresql").escapeVal;
exports.escapeVal = function (val, timeZone) {
if (val === undefined || val === null) {
return 'NULL';
}
if (Array.isArray(val)) {
if (val.length === 1 && Array.isArray(val[0])) {
return "(" + val[0].map(exports.escapeVal.bind(this)) + ")";
}
return "(" + val.map(exports.escapeVal.bind(this)).join(", ") + ")";
}
if (util.isDate(val)) {
return "'" + JSON.stringify(val).substr(1, 24) + "'";
}
if (Buffer.isBuffer(val)) {
return "X'" + val.toString("hex") + "'";
}
switch (typeof val) {
case "number":
return val;
case "boolean":
return val ? "true" : "false";
}
// No need to escape backslashes with default PostgreSQL 9.1+ config.
// Google 'postgresql standard_conforming_strings' for details.
return "'" + val.replace(/\'/g, "''") + "'";
};

2

package.json

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

],
"version": "0.1.0",
"version": "0.1.1",
"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