Last active
December 23, 2015 19:09
-
-
Save SinisterMinister/6680406 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Single ORM instance usage | |
ORM.create(mysqlRepository).then(function (orm) { | |
/* App logic goes here */ | |
orm.factory('foo'); | |
}, err); | |
// Multiple ORM instance usage | |
var ORMs = { | |
mysqlOrm: ORM.create(mysqlRepository), | |
mongoOrm: ORM.create(mongoRepository), | |
cass: ORM.create(cassandraRepository), | |
}; | |
// Group them together. Not sure on the name of the function, so ready for now | |
ORM.ready(ORMs).then(function (orm) { | |
/* App logic goes here */ | |
orm.mysqlOrm.factory('user').findAll(); | |
orm.mongoOrm.factory('thingy').create(); | |
orm.cass.factory('stuff').find(27); | |
}, err); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Shouldn't it be ._ready(ORMs) ?
/rubberducky