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

sqb

Package Overview
Dependencies
Maintainers
1
Versions
174
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sqb - npm Package Compare versions

Comparing version 1.1.0 to 1.2.0

9

lib/Serializable.js

@@ -13,3 +13,5 @@ /* SQB

*/
const merge = require('putil-merge');
const ParamType = require('./enums').ParamType;
const ReservedWords = [

@@ -151,2 +153,3 @@ 'schema', 'table', 'field', 'index',

const prmValue = ctx.values[name];
ctx.prmValue = prmValue == null ? null : prmValue;
switch (ctx.paramType) {

@@ -157,11 +160,11 @@ case ParamType.COLON:

const symb = ctx.paramType === ParamType.COLON ? ':' : '@';
ctx.outValues[name] = prmValue == null ? null : prmValue;
ctx.outValues[name] = ctx.prmValue;
return symb + name;
}
case ParamType.DOLLAR: {
ctx.outValues.push(prmValue == null ? null : prmValue);
ctx.outValues.push(ctx.prmValue);
return '$' + (ctx.outValues.length);
}
case ParamType.QUESTION_MARK: {
ctx.outValues.push(prmValue == null ? null : prmValue);
ctx.outValues.push(ctx.prmValue);
return '?';

@@ -168,0 +171,0 @@ }

@@ -39,2 +39,4 @@ /* SQB

CompOperator.prototype._serialize = function(ctx) {
const self = this;
ctx.operatorType = self.operatorType;

@@ -46,12 +48,17 @@ const serializeValue = function(val) {

operatorType: this.operatorType,
expression:
this._expression.isSerializable ?
(this._expression.isQuery ?
'(' + this._expression._serialize(ctx) + ')' :
this._expression._serialize(ctx)) :
String(this._expression),
value1: serializeValue(this._value1),
value2: this._value2 ? serializeValue(this._value2) : null
expression: this._expression.isSerializable ?
(this._expression.isQuery ?
'(' + this._expression._serialize(ctx) + ')' :
this._expression._serialize(ctx)) :
String(this._expression)
};
const self = this;
ctx.operatorValue1 = this._value1;
o.value1 = serializeValue(ctx.operatorValue1);
ctx.prmValue1 = ctx.prmValue;
delete ctx.prmValue;
ctx.operatorValue2 = this._value2 ? serializeValue(this._value2) : null;
o.value2 = ctx.operatorValue2;
ctx.prmValue2 = ctx.prmValue;
delete ctx.prmValue;
return Serializable.serializeFallback(ctx, 'operator', o, function() {

@@ -58,0 +65,0 @@ return self.__serialize(ctx, o);

@@ -62,3 +62,3 @@ /* SQB

});
return Serializable.serializeFallback(ctx, 'operator_and', arr, function() {
return Serializable.serializeFallback(ctx, 'operator', arr, function() {
var s = Serializable.joinArray(arr, ' and');

@@ -65,0 +65,0 @@ return (s.indexOf('n') > 0) ? s.replace('\n', '\n\t') + '\b' : s;

@@ -28,3 +28,4 @@ /* SQB

CompOperator.apply(this, [expression,
Array.isArray(value) || value instanceof RegExp ? value : [value]]);
Array.isArray(value) || value instanceof RegExp ?
value : [value]]);
}

@@ -31,0 +32,0 @@

@@ -62,3 +62,3 @@ /* SQB

});
return Serializable.serializeFallback(ctx, 'operator_or', arr, function() {
return Serializable.serializeFallback(ctx, 'operator', arr, function() {
var s = Serializable.joinArray(arr, ' or');

@@ -65,0 +65,0 @@ return (s.indexOf('n') > 0) ? s.replace('\n', '\n\t') + '\b' : s;

{
"name": "sqb",
"description": "Extensible, multi-dialect SQL query builder and Database connection framework for JavaScript",
"version": "1.1.0",
"version": "1.2.0",
"author": "Panates Ltd.",

@@ -6,0 +6,0 @@ "contributors": [

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