ee-query-builder
Advanced tools
Comparing version 0.1.22 to 0.1.23
@@ -363,5 +363,6 @@ !function(){ | ||
case 'object': | ||
if (type.function(filter.isQuery)) { | ||
filter.limit(1); | ||
return this._escapeId(entity)+'.'+this._escapeId(property)+' = ('+this._render('query', filter.getResource().query, parameters).SQLString+')'; | ||
if (type.function(filter.isQuery) && filter.isQuery()) { | ||
// returns it | ||
return this._escapeId(entity)+'.'+this._escapeId(property)+' = ('+this._render('query', this._prepareQueryFilter(filter), parameters).SQLString+')'; | ||
} | ||
@@ -402,2 +403,16 @@ else { | ||
/* | ||
* compile a query | ||
*/ | ||
, _prepareQueryFilter: function(filter){ | ||
var resource = filter.getRootResource(); | ||
resource.selectMode(); | ||
resource.prepare(); | ||
return resource.query | ||
} | ||
, _renderCommand: function(property, command, parameters, entity){ | ||
@@ -414,8 +429,7 @@ var id, result; | ||
// is it a subquery or is it scalar value? | ||
if (command.query){ | ||
if (command.query) { | ||
return entity+this._escapeId(property) + ' ' + this._operators[command.operator] + ' (' + this._render('query', command.query, parameters).SQLString +')'; | ||
} | ||
else if (type.function(command.value.isQuery)) { | ||
command.value.limit(1); | ||
return entity+this._escapeId(property)+' '+this._operators[command.operator]+ ' (' + this._render('query', command.value.getResource().query, parameters).SQLString +')'; | ||
else if (type.function(command.value.isQuery) && command.value.isQuery()) { | ||
return entity+this._escapeId(property)+' '+this._operators[command.operator]+ ' (' + this._render('query', this._prepareQueryFilter(command.value), parameters).SQLString +')'; | ||
} | ||
@@ -422,0 +436,0 @@ else { |
{ | ||
"name" : "ee-query-builder" | ||
, "description" : "query builder for ee-orm" | ||
, "version" : "0.1.22" | ||
, "version" : "0.1.23" | ||
, "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
19852
464