platform/archived_packages/relations
thomashii@dukefirehawk.com 5bea55d2c0 Updated Change Log
2022-08-16 19:19:04 +08:00
..
lib Added melos 2022-03-19 09:37:28 +08:00
test Added melos 2022-03-19 09:37:28 +08:00
.gitignore Added melos 2022-03-19 09:37:28 +08:00
.travis.yml Added melos 2022-03-19 09:37:28 +08:00
analysis_options.yaml Added melos 2022-03-19 09:37:28 +08:00
AUTHORS.md Added melos 2022-03-19 09:37:28 +08:00
CHANGELOG.md Updated Change Log 2022-08-16 19:19:04 +08:00
LICENSE Added melos 2022-03-19 09:37:28 +08:00
pubspec.yaml Added melos 2022-03-19 09:37:28 +08:00
README.md Added melos 2022-03-19 09:37:28 +08: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