Comparing version 0.3.3 to 0.3.4
{ | ||
"name" : "ee-orm" | ||
, "description" : "An easy to use ORM for node.js. Supports advanced eager loading, complex queries, joins, transactions, complex database clusters & connection pooling." | ||
, "version" : "0.3.3" | ||
, "version" : "0.3.4" | ||
, "homepage" : "https://github.com/eventEmitter/ee-orm" | ||
@@ -6,0 +6,0 @@ , "author" : "Michael van der Weg <michael@eventemitter.com> (http://eventemitter.com/)" |
20
test.js
@@ -26,5 +26,2 @@ | ||
db.event({id: ORM.and(2,3)}).find(cb); | ||
return; | ||
/*return new db.eventLocasle({ | ||
@@ -35,3 +32,4 @@ description : 'ssome text' | ||
}).save(log);*/ | ||
var i = 1 | ||
var i = 1000 | ||
, ok = fail = 0 | ||
, items = []; | ||
@@ -44,2 +42,4 @@ | ||
async.each(items, function(nope, cb){ | ||
//db.event({id:1}).find(cb); | ||
//return; | ||
new db.event({ | ||
@@ -49,4 +49,12 @@ title: Math.random() | ||
, startdate: new Date() | ||
}).save(cb); | ||
}, cb); | ||
}).save(function(err){ | ||
if (err) fail++; | ||
else ok++; | ||
cb(err); | ||
}); | ||
}, function(err){ | ||
log.info(ok); | ||
log.error(fail); | ||
log(err); | ||
}); | ||
}, 1500); | ||
@@ -53,0 +61,0 @@ |
@@ -361,2 +361,3 @@ | ||
// complex query tests | ||
@@ -384,2 +385,3 @@ describe('Querying Data with advanced eager loading', function(){ | ||
describe('Updating existing Data', function(){ | ||
@@ -396,2 +398,18 @@ it('for a simple entity using the loaded model should work', function(done){ | ||
it('for a simple entity with two updates using the loaded model should work', function(done){ | ||
new db.event({ | ||
startdate: new Date() | ||
, title: 'bender' | ||
, venue: db.venue({id:1}) | ||
}).save(function(err, event){ | ||
if (err) done(err); | ||
else { | ||
event.title = 'Changed title'; | ||
event.enddate = new Date(1400000000000); | ||
event.startdate = new Date(0); | ||
event.save(expect('{"id":4,"venue":{"id":1,"name":"Dachstock Reitschule"},"title":"Changed title","startdate":"1970-01-01T00:00:00.000Z","enddate":"2014-05-13T16:53:20.000Z","canceled":null}', done)); | ||
} | ||
}); | ||
}); | ||
it('with a reference fetched using a query', function(done){ | ||
@@ -485,3 +503,3 @@ db.event({id:1}).findOne(function(err, event){ | ||
it('Filter using null', function(done){ | ||
db.event({canceled: null}).find(expect('[{"id":1,"title":"Changed title","startdate":"1970-01-01T00:00:00.000Z","enddate":null,"canceled":null},{"id":2,"title":"Mapping Test","startdate":"1970-01-01T00:00:00.000Z","enddate":null,"canceled":null}]', done)); | ||
db.event({canceled: null}).find(expect('[{"id":4,"title":"Changed title","startdate":"1970-01-01T00:00:00.000Z","enddate":"2014-05-13T16:53:20.000Z","canceled":null},{"id":1,"title":"Changed title","startdate":"1970-01-01T00:00:00.000Z","enddate":null,"canceled":null},{"id":2,"title":"Mapping Test","startdate":"1970-01-01T00:00:00.000Z","enddate":null,"canceled":null}]', done)); | ||
}); | ||
@@ -502,3 +520,3 @@ | ||
it('Records with the > operator', function(done){ | ||
db.event({id: ORM.gt(2)}).find(expect('[{"id":3,"title":"Mapping Test","startdate":"1970-01-01T00:00:00.000Z","enddate":null,"canceled":true}]', done)); | ||
db.event({id: ORM.gt(2)}).find(expect('[{"id":3,"title":"Mapping Test","startdate":"1970-01-01T00:00:00.000Z","enddate":null,"canceled":true},{"id":4,"title":"Changed title","startdate":"1970-01-01T00:00:00.000Z","enddate":"2014-05-13T16:53:20.000Z","canceled":null}]', done)); | ||
}); | ||
@@ -511,3 +529,3 @@ | ||
it('Records with the >= operator', function(done){ | ||
db.event({id: ORM.gte(2)}).find(expect('[{"id":3,"title":"Mapping Test","startdate":"1970-01-01T00:00:00.000Z","enddate":null,"canceled":true},{"id":2,"title":"Mapping Test","startdate":"1970-01-01T00:00:00.000Z","enddate":null,"canceled":null}]', done)); | ||
db.event({id: ORM.gte(2)}).find(expect('[{"id":3,"title":"Mapping Test","startdate":"1970-01-01T00:00:00.000Z","enddate":null,"canceled":true},{"id":4,"title":"Changed title","startdate":"1970-01-01T00:00:00.000Z","enddate":"2014-05-13T16:53:20.000Z","canceled":null},{"id":2,"title":"Mapping Test","startdate":"1970-01-01T00:00:00.000Z","enddate":null,"canceled":null}]', done)); | ||
}); | ||
@@ -535,7 +553,7 @@ | ||
describe('Connection Pooling', function(){ | ||
/*it('should be able to insert 1000 items at once', function(done){ | ||
it('should be able to insert 1000 items at once', function(done){ | ||
var i = 1000 | ||
, items = []; | ||
this.timeout(30000); | ||
this.timeout(120000); | ||
@@ -551,5 +569,5 @@ while(i--) items.push(i); | ||
}, done); | ||
});*/ | ||
}); | ||
}); | ||
}); | ||
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
166437
3120