The Protevus Platform: Unified Full-Stack Development https://protevus.com
Find a file
2017-01-29 21:43:01 -05:00
lib alpha 2017-01-29 21:39:11 -05:00
test alpha 2017-01-29 21:39:11 -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 pubspec 2017-01-29 21:43:01 -05:00
README.md alpha 2017-01-29 21:39:11 -05:00

relations

version 1.0.0-alpha 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