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

@evershop/postgres-query-builder

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@evershop/postgres-query-builder - npm Package Compare versions

Comparing version 1.0.6 to 1.0.7

40

index.js

@@ -46,2 +46,28 @@ const uniqid = require('uniqid');

class RawLeaf {
constructor(link, rawSql, binding = {}) {
this._link = link;
this._binding = binding;
this._rawSql = rawSql;
}
getBinding() {
return this._binding;
}
parent() {
return this._parent;
}
render() {
return `${this._link} ${this._rawSql}`;
}
clone(node) {
let cp = new RawLeaf(this._link, this._rawSql, this._binding);
cp._parent = node;
return cp;
}
}
class Leaf {

@@ -145,2 +171,7 @@ constructor(link, field, operator, value, node) {

addRaw(link, sql, binding = {}) {
this._tree.push(new RawLeaf(link, sql, binding));
return this;
}
addNode(node) {

@@ -161,3 +192,5 @@ node._parent = this;

getLeafs() {
return this._tree.filter((e) => e.constructor.name === 'Leaf');
return this._tree.filter(
(e) => e.constructor.name === 'Leaf' || e.constructor.name === 'RawLeaf'
);
}

@@ -238,3 +271,3 @@

cp._tree = this._tree.map((t) => {
if (t.constructor === Leaf) {
if (t.constructor === Leaf || t.constructor === RawLeaf) {
return t.clone(cp);

@@ -445,2 +478,3 @@ } else {

this._where = new Where(this);
this._where._link = 'AND';
this._binding = [];

@@ -615,3 +649,3 @@ }

this.removeOrderBy();
return await super.execute(connection, releaseConnection);
return await super.execute(connection, false);
} else if (e.code.toLowerCase() === '22p02') {

@@ -618,0 +652,0 @@ // In case of invalid input type, we consider it as empty result

2

package.json
{
"name": "@evershop/postgres-query-builder",
"version": "1.0.6",
"version": "1.0.7",
"description": "A PostgreSQL query builder for NodeJS",

@@ -5,0 +5,0 @@ "main": "index.js",

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