Comparing version 0.2.3 to 0.2.4
@@ -119,3 +119,3 @@ !function(){ | ||
, reload: function(callback, connection){ | ||
, reload: function(callback, transaction){ | ||
var query = { | ||
@@ -135,3 +135,3 @@ select : ['*'] | ||
(connection || this._orm.getDatabase()).query(query, function(err, data){ | ||
(transaction || this._orm.getDatabase()).executeQuery(query, function(err, data){ | ||
if (err) callback(err); | ||
@@ -281,4 +281,6 @@ else { | ||
if (this._defintion.primaryKeys.length) query.returning = this._defintion.primaryKeys[0]; | ||
this._saveChildren(connection, noReload, function(err){ | ||
/*this._saveChildren(connection, noReload, function(err){ | ||
if (err) callback(err); | ||
@@ -288,3 +290,3 @@ else { | ||
} | ||
}.bind(this)); | ||
}.bind(this));*/ | ||
@@ -317,3 +319,3 @@ | ||
if (!noReload) this.reload(callback, connection); | ||
if (!noReload) this.reload(callback, transaction); | ||
else callback(null, this); | ||
@@ -320,0 +322,0 @@ } |
@@ -8,3 +8,2 @@ !function(){ | ||
, arg = require('ee-arguments') | ||
, pluralize = require('pluralize') | ||
, async = require('ee-async') | ||
@@ -11,0 +10,0 @@ , DBCluster = require('ee-db-cluster'); //*/require('../../ee-db-cluster'); |
@@ -9,4 +9,2 @@ !function(){ | ||
, type = require('ee-types') | ||
, pluralize = require('pluralize') | ||
, merge = require('merge') | ||
, Set = require('./Set') | ||
@@ -417,4 +415,15 @@ , Query = require('./Query') | ||
, _addPrimarySelect: function() { | ||
if (this._rootResource.query.select.length) { | ||
this._definition.primaryKeys.forEach(function(key){ | ||
this._rootResource.query.select.push(key); | ||
}.bind(this)); | ||
} | ||
} | ||
, find: function(callback) { | ||
this._addPrimarySelect(); | ||
new QueryCompiler({ | ||
@@ -429,2 +438,4 @@ orm : this._orm | ||
, findOne: function(callback) { | ||
this._addPrimarySelect(); | ||
new QueryCompiler({ | ||
@@ -431,0 +442,0 @@ orm : this._orm |
@@ -38,5 +38,5 @@ !function(){ | ||
this._query(mode, query, callback); | ||
this.executeQuery(mode, query, callback); | ||
} | ||
}); | ||
}.bind(this)); | ||
} | ||
@@ -50,5 +50,5 @@ }} | ||
, _transaction: {value: null} | ||
, _transaction: {value: null, writable:true, configurable: true} | ||
}); | ||
} | ||
}(); |
{ | ||
"name" : "ee-orm" | ||
, "description" : "a simple yet powerful javascript orm for node.js supporting mysql & postgres" | ||
, "version" : "0.2.3" | ||
, "version" : "0.2.4" | ||
, "homepage" : "https://github.com/eventEmitter/ee-orm" | ||
@@ -26,4 +26,2 @@ , "author" : "Michael van der Weg <michael@eventemitter.com> (http://eventemitter.com/)" | ||
, "clone" : "0.1.x" | ||
, "pluralize" : "0.0.x" | ||
, "merge" : "1.1.x" | ||
, "ee-db-cluster" : "0.1.x" | ||
@@ -30,0 +28,0 @@ } |
@@ -337,3 +337,10 @@ # ee-orm | ||
##### Advanced Filtering | ||
The filter object which can be used by the queryuilder and the filter mehotd can contain the following structure | ||
- tbd | ||
#### Reserved Keywords | ||
@@ -364,3 +371,3 @@ | ||
On the Database level the following keywords are reserved (your database should not contain any tables using on of the names listed below): | ||
On the Database level the following keywords are reserved (your database should not contain any tables using one of the names listed below): | ||
@@ -367,0 +374,0 @@ - $$$$_events |
23
test.js
@@ -21,8 +21,10 @@ | ||
while(i--) arr.push(1); | ||
log(orm); | ||
log(orm.eventbooster.resource().describeMethods()); | ||
log(orm); | ||
log.wtf('hajo jüfe'); | ||
return; | ||
//log(orm.eventbooster.resource().describeMethods()); | ||
//new orm.eventbooster.resource({key: 'email.test.1'+Math.random(), id_tenant: 0}).save(log); | ||
/** | ||
@@ -46,4 +48,4 @@ // insert 1000 roles | ||
orm.eventbox.venue.setMappingAccessorName('venue_media', 'media'); | ||
orm.eventbox.venue.setReferenceAccessorName('id_media', 'logo'); | ||
/*orm.eventbox.venue.setMappingAccessorName('venue_media', 'media'); | ||
orm.eventbox.venue.setReferenceAccessorName('id_media', 'logo');*/ | ||
@@ -87,3 +89,3 @@ | ||
/* | ||
var transaction = orm.eventbox.createTransaction() | ||
@@ -101,8 +103,8 @@ , query = transaction.event(['*'], {_:[{id:3},{id:2}]}).limit(10).offset(0); | ||
query.fetchMedia(['*']); | ||
*/ | ||
//query.fetchHighlightType(['name'], {id: ORM.notNull()}); | ||
query.find(function(err, events){ | ||
orm.eventbooster.resource(['key']).find(function(err, resources){ | ||
console.timeEnd("query") | ||
@@ -113,4 +115,5 @@ log(err); | ||
log(resources); | ||
//events.first().reload(); | ||
log(JSON.stringify(events)); | ||
//log(JSON.stringify(resources)); | ||
/*events.forEach(function(event){ | ||
@@ -117,0 +120,0 @@ event.venues.forEach(function(venue){ |
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
95931
8
2202
472
10
- Removedmerge@1.1.x
- Removedpluralize@0.0.x
- Removedmerge@1.1.3(transitive)
- Removedpluralize@0.0.12(transitive)