19.0.7 • Published 3 years ago

chaos-orm v19.0.7

Weekly downloads
13
License
MIT
Repository
github
Last release
3 years ago

chaos-orm

Build Status Coverage Status

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:

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).

Install

npm install chaos-orm

Note: Require babel-polyfill as a peer dependency

Main Features

  • Support eager loading
  • Support nested saving
  • Support external & embedded relationship
  • Support custom types & entities' field casting

Example of syntax:

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'
});

Documentation

See the whole documentation here.

Testing

The spec suite can be runned with:

cd chaos-orm
npm install
npm test
19.0.5

3 years ago

19.0.4

3 years ago

19.0.7

3 years ago

19.0.6

3 years ago

19.0.3

3 years ago

19.0.1

4 years ago

19.0.2

4 years ago

19.0.0

4 years ago

18.0.0

4 years ago

17.0.1

5 years ago

17.0.0

5 years ago

16.0.4

5 years ago

16.0.3

5 years ago

16.0.2

5 years ago

16.0.1

6 years ago

16.0.0

6 years ago

15.0.12

6 years ago

15.0.11

6 years ago

15.0.10

6 years ago

15.0.9

6 years ago

15.0.8

6 years ago

15.0.7

6 years ago

15.0.6

6 years ago

15.0.5

6 years ago

15.0.4

6 years ago

15.0.3

6 years ago

15.0.1

6 years ago

15.0.0

7 years ago

14.0.10

7 years ago

14.0.9

7 years ago

14.0.8

7 years ago

14.0.7

7 years ago

14.0.6

8 years ago

14.0.5

8 years ago

14.0.4

8 years ago

14.0.3

8 years ago

14.0.2

8 years ago

14.0.1

8 years ago

14.0.0

8 years ago

13.0.0

8 years ago

12.0.0

8 years ago

11.0.0

8 years ago

10.0.5

8 years ago

10.0.4

8 years ago

10.0.3

8 years ago

10.0.2

9 years ago

10.0.1

9 years ago

10.0.0

9 years ago

9.0.1

9 years ago

9.0.0

9 years ago

8.0.2

9 years ago

8.0.1

9 years ago

8.0.0

9 years ago

7.0.0

9 years ago

6.0.2

9 years ago

6.0.1

9 years ago

6.0.0

9 years ago

5.0.1

9 years ago

5.0.0

9 years ago

4.0.0

9 years ago

3.0.0

9 years ago

2.0.0

9 years ago

1.1.4

9 years ago

1.1.3

9 years ago

1.1.2

10 years ago

1.1.1

10 years ago

1.1.0

10 years ago

1.0.0

10 years ago

0.1.4

10 years ago

0.1.3

10 years ago

0.1.2

10 years ago

0.1.1

10 years ago

0.1.0

10 years ago