Socket
Socket
Sign inDemoInstall

ee-orm

Package Overview
Dependencies
Maintainers
2
Versions
156
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ee-orm - npm Package Compare versions

Comparing version 0.7.2 to 0.7.3

36

lib/Resource.js

@@ -421,6 +421,11 @@ !function () {

// take the joins, apply them to the parent
joins.forEach(function(joinStatement, index) {
joins.forEach(function(joinStatement) {
currentTargetResource.query.join.push(joinStatement.reverseFormat());
}.bind(this));
// we need to add ou filter and joins to all branches sourcing from here
this._joinAndFilterSideTree(name, sourceResource.filters, joins, currentTargetResource, lastTargetResource);
// we should not join any table twice, check if we joined this pair already

@@ -443,2 +448,31 @@ if (currentTargetResource.subJoinApplied && lastTargetResource.subJoinApplied) {

/*
* add filters to side branches
*/
, _joinAndFilterSideTree: function(sourceName, filters, joins, resource, parentResource) {
if (resource && resource.hasChildren()) {
resource.getChildren().forEach(function(childResource) {
if (childResource.name !== sourceName && (!parentResource || parentResource.name !== childResource.name)) {
//log.warn('%s applying itself to %s; %s', sourceName, childResource.name, parentResource ? parentResource.name : undefined, filters);
// make sure there is an object to write to
if (!childResource.query.filter[sourceName]) childResource.query.filter[sourceName] = {};
Object.keys(filters).forEach(function(key){
childResource.query.filter[sourceName][key] = filters[key];
});
// take the joins, apply them to the parent
joins.forEach(function(joinStatement) {
childResource.query.join.push(joinStatement.reverseFormat());
}.bind(this));
// go down the branch
this._joinAndFilterSideTree(sourceName, filters, joins, childResource, resource);
}
}.bind(this));
}
}
/*
* add my own pks to the select statement

@@ -445,0 +479,0 @@ */

2

package.json
{
"name" : "ee-orm"
, "description" : "ORM for node.js supporting postgres or mysql. Supports eager loading, complex queries, joins, transactions, complex database clusters & connection pooling."
, "version" : "0.7.2"
, "version" : "0.7.3"
, "homepage" : "https://github.com/eventEmitter/ee-orm"

@@ -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