The Protevus Platform: Unified Full-Stack Development https://protevus.com
Find a file
2017-07-09 13:11:17 -04:00
lib Needed no actual changes... 2017-07-09 13:11:17 -04:00
test Needed no actual changes... 2017-07-09 13:11:17 -04:00
.gitignore Needed no actual changes... 2017-07-09 13:11:17 -04: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 Needed no actual changes... 2017-07-09 13:11:17 -04:00
README.md 1.0.1 2017-03-04 16:05:56 -05:00

relations

version 1.0.1 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'));

Supports:

  • hasOne
  • hasMany
  • hasManyThrough
  • belongsTo
  • belongsToMany