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.0.22 to 0.0.23

5

lib/Dialects/postgresql.js

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

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

@@ -27,2 +29,5 @@ return Array.prototype.slice.apply(arguments).map(function (el) {

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

@@ -29,0 +34,0 @@ case "number":

2

lib/Where.js

@@ -40,3 +40,3 @@ exports.build = function (Dialect, where) {

for (var k in where.w) {
if (!where.w[k]) {
if (where.w[k] === null || where.w[k] === undefined) {
query.push(

@@ -43,0 +43,0 @@ buildComparisonKey(Dialect, where.t, k) +

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

],
"version": "0.0.22",
"version": "0.0.23",
"license": "MIT",

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

@@ -20,2 +20,32 @@ var common = require('../common');

assert.equal(
common.Select().from('table1').where({ col: 0 }).build(),
"SELECT * FROM `table1` WHERE `col` = 0"
);
assert.equal(
common.Select().from('table1').where({ col: null }).build(),
"SELECT * FROM `table1` WHERE `col` IS NULL"
);
assert.equal(
common.Select().from('table1').where({ col: undefined }).build(),
"SELECT * FROM `table1` WHERE `col` IS NULL"
);
assert.equal(
common.Select().from('table1').where({ col: false }).build(),
"SELECT * FROM `table1` WHERE `col` = false"
);
assert.equal(
common.Select().from('table1').where({ col: "" }).build(),
"SELECT * FROM `table1` WHERE `col` = ''"
);
assert.equal(
common.Select().from('table1').where({ col: true }).build(),
"SELECT * FROM `table1` WHERE `col` = true"
);
assert.equal(
common.Select().from('table1').where({ col: 'a' }).build(),

@@ -22,0 +52,0 @@ "SELECT * FROM `table1` WHERE `col` = 'a'"

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