ee-query-builder
Advanced tools
Comparing version 0.2.0 to 0.2.1
@@ -96,14 +96,16 @@ !function(){ | ||
// postgres cannot limit deletes, we have to build a subselect | ||
log(query); | ||
SQLString += ' WHERE CTID IN (' + this._render('query', { | ||
select : [function() {return {keyWord: 'CTID'};}] | ||
, from : query.from | ||
, database : query.database | ||
, filter : query.filter | ||
, join : query.join | ||
, order : query.order | ||
, group : query.group | ||
, limit : query.limit | ||
, offset : query.offset | ||
}, parameters).SQLString+')'; | ||
// we need to render a subquery for every selected field (primary key) | ||
SQLString += ' WHERE ' + query.select.map(function(column) { | ||
return this._escapeId(query.from)+'.'+this._escapeId(column)+' IN('+this._render('query', { | ||
select : [column] | ||
, from : query.from | ||
, database : query.database | ||
, filter : query.filter | ||
, join : query.join | ||
, order : query.order | ||
, group : query.group | ||
, limit : query.limit | ||
, offset : query.offset | ||
}, parameters).SQLString+')' | ||
}.bind(this)).join(' AND '); | ||
} | ||
@@ -174,14 +176,17 @@ else { | ||
// postgres cannot limit updates, we have to build a subselect | ||
log(query); | ||
SQLString += ' WHERE CTID IN (' + this._render('query', { | ||
select : [function() {return {keyWord: 'CTID'};}] | ||
, from : query.from | ||
, database : query.database | ||
, filter : query.filter | ||
, join : query.join | ||
, order : query.order | ||
, group : query.group | ||
, limit : query.limit | ||
, offset : query.offset | ||
}, parameters).SQLString+')'; | ||
// we need to render a subquery for every selected field (primary key) | ||
SQLString += ' WHERE ' + query.select.map(function(column) { | ||
return this._escapeId(query.from)+'.'+this._escapeId(column)+' IN('+this._render('query', { | ||
select : [column] | ||
, from : query.from | ||
, database : query.database | ||
, filter : query.filter | ||
, join : query.join | ||
, order : query.order | ||
, group : query.group | ||
, limit : query.limit | ||
, offset : query.offset | ||
}, parameters).SQLString+')' | ||
}.bind(this)).join(' AND '); | ||
} | ||
@@ -188,0 +193,0 @@ else { |
{ | ||
"name" : "ee-query-builder" | ||
, "description" : "query builder for ee-orm" | ||
, "version" : "0.2.0" | ||
, "version" : "0.2.1" | ||
, "homepage" : "https://github.com/eventEmitter/ee-query-builder" | ||
@@ -6,0 +6,0 @@ , "author" : "Michael van der Weg <michael@eventemitter.com> (http://eventemitter.com/)" |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
22938
515