Datastore Agnostic Model Layer
npm install chaos-orm

Chaos is an independent, persistence-agnostic layer responsible for defining entities' business logic and relationships. It allows to describe a Domain Model without any assumption about the persistence layer.
Available datasources libraries:
* MySQL
* PostgreSQL
* Sqlite
Chaos dramatically simplify the developpment of a datasources libraries by providing all persistence-agnostic logic like relationships, eager loading at the root level. The only requirement is the datasource you envisionned to use need to be able to fetch a record/document thanks to a unique identifier (i.e no composite primary key).
``bash`
npm install chaos-orm
__Note: Require babel-polyfill as a peer dependency__
* Support eager loading
* Support nested saving
* Support external & embedded relationship
* Support custom types & entities' field casting
`php
import co from 'co';
import Image from './model/Images';
co(function* () {
// Adding a many-to-many relation
var image = yield Image.load(123, { 'embed': 'tags' });
image.push({ name: 'Landscape' });
yield image.broadcast();
image.tags.forEach(function(tag) {
console.log(tag.get('name'));
}); // Echoes: 'Montain', 'Black&White', 'Landscape'
});
`
See the whole documentation here.
The spec suite can be runned with:
`bash``
cd chaos-orm
npm install
npm test