The Protevus Platform: Unified Full-Stack Development https://protevus.com
Find a file
2017-03-04 16:00:17 -05:00
lib 1.0.0 2017-03-04 16:00:17 -05:00
test 1.0.0 2017-03-04 16:00:17 -05:00
.gitignore alpha 2017-01-29 21:39:11 -05:00
.travis.yml alpha 2017-01-29 21:39:11 -05:00
LICENSE Initial commit 2017-01-29 15:23:53 -05:00
pubspec.yaml 1.0.0 2017-03-04 16:00:17 -05:00
README.md 1.0.0 2017-03-04 16:00:17 -05:00

relations

version 1.0.0 build status

Database-agnostic relations between Angel services.

// Authors owning one book
app.service('authors').afterAll(
    relations.hasOne('books', as: 'book', foreignKey: 'authorId'));

// Or multiple
app.service('authors').afterAll(
    relations.hasMany('books', foreignKey: 'authorId'));

// Or, books belonging to authors
app.service('books').afterAll(relations.belongsTo('authors'));

Currently supports:

  • hasOne
  • hasMany
  • belongsTo