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

ee-query-builder

Package Overview
Dependencies
Maintainers
1
Versions
44
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ee-query-builder - npm Package Compare versions

Comparing version 0.1.1 to 0.1.2

27

lib/QueryBuilder.js

@@ -72,3 +72,6 @@ !function(){

case 'delete':
return this._buildDeleteQuery(query, parameters);
default:

@@ -80,2 +83,21 @@ throw new Error('Unknown query mode «'+mode+'»!').setName('InvalidModeException');

, _buildDeleteQuery: function(query, parameters) {
var SQLString = 'DELETE FROM '
, keys = []
, values = [];
// from
SQLString += this._renderFrom(query.database, query.from);
SQLString += ' WHERE ' + (this._renderFilter(parameters, query.filter || {}) || 1);
if(query.limit && !isNaN(parseInt(query.limit, 10))) SQLString += ' LIMIT ' + parseInt(query.limit, 10);
if(query.offset && !isNaN(parseInt(query.offset, 10))) SQLString += ' OFFSET ' + parseInt(query.offset, 10);
return {SQLString: SQLString, parameters: parameters};
}
, _buildInsertQuery: function(query, parameters) {

@@ -119,2 +141,5 @@ var SQLString = 'INSERT INTO '

if(query.limit && !isNaN(parseInt(query.limit, 10))) SQLString += ' LIMIT ' + parseInt(query.limit, 10);
if(query.offset && !isNaN(parseInt(query.offset, 10))) SQLString += ' OFFSET ' + parseInt(query.offset, 10);
return {SQLString: SQLString, parameters: parameters};

@@ -138,3 +163,3 @@ }

// render filter (where statement)
SQLString += ' WHERE ' + (this._renderFilter(parameters, query.filter || {}) || 1);
if (query.filter && Object.keys(query.filter).length) SQLString += ' WHERE ' + (this._renderFilter(parameters, query.filter || {}) || 1);

@@ -141,0 +166,0 @@ // render order statement

2

package.json
{
"name" : "ee-query-builder"
, "description" : "query builder for ee-orm"
, "version" : "0.1.1"
, "version" : "0.1.2"
, "homepage" : "https://github.com/eventEmitter/ee-query-builder"

@@ -6,0 +6,0 @@ , "author" : "Michael van der Weg <michael@eventemitter.com> (http://eventemitter.com/)"

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