angel_relations 1.0.0

  • README.md
  • Installing
  • Versions
  • 11

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

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  angel_relations: ^1.0.0

2. Install it

You can install packages from the command line:

with pub:


$ pub get

Alternatively, your editor might support pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:angel_relations/angel_relations.dart';
  
Version Uploaded Documentation Archive
1.0.1 Mar 4, 2017 Go to the documentation of angel_relations 1.0.1 Download angel_relations 1.0.1 archive
1.0.0 Mar 4, 2017 Go to the documentation of angel_relations 1.0.0 Download angel_relations 1.0.0 archive
1.0.0-alpha Jan 30, 2017 Go to the documentation of angel_relations 1.0.0-alpha Download angel_relations 1.0.0-alpha archive
Popularity:
Describes how popular the package is relative to other packages. [more]
22
Health:
Code health derived from static analysis. [more]
0
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
0
Overall:
Weighted score of the above. [more]
11
Learn more about scoring.

We analyzed this package on Sep 12, 2018, and provided a score, details, and suggestions below. Analysis was completed with status tool failures using:

  • Dart: 2.0.0
  • pana: 0.12.2

Platforms

Detected platforms: unsure

Error(s) prevent platform classification:

Fix dependencies in pubspec.yaml.

Analysis issues and suggestions

Fix dependencies in pubspec.yaml.

Running pub upgrade failed with the following output:

ERR: The current Dart SDK version is 2.0.0.
 
 Because angel_framework >=0.0.0-dev.1 <1.1.3 requires SDK version <2.0.0 and angel_framework >=1.1.3 <2.0.0-alpha depends on random_string ^0.0.1, angel_framework >=0.0.0-dev.1 <2.0.0-alpha requires random_string ^0.0.1.
 So, because every version of random_string requires SDK version >=1.0.0 <2.0.0 and angel_relations depends on angel_framework ^1.0.0-dev, version solving failed.

Health suggestions

Format lib/angel_relations.dart.

Run dartfmt to format lib/angel_relations.dart.

Format lib/src/has_many.dart.

Run dartfmt to format lib/src/has_many.dart.

Format lib/src/has_one.dart.

Run dartfmt to format lib/src/has_one.dart.

Format lib/src/no_service.dart.

Run dartfmt to format lib/src/no_service.dart.

Maintenance issues and suggestions

Fix platform conflicts. (-20 points)

Error(s) prevent platform classification:

Fix dependencies in pubspec.yaml.

Maintain CHANGELOG.md. (-20 points)

Changelog entries help clients to follow the progress in your code.

Package is getting outdated. (-52.33 points)

The package was released 79 weeks ago.

The description is too short. (-20 points)

Add more detail about the package, what it does and what is its target use case. Try to write at least 60 characters.

Maintain an example. (-10 points)

Create a short demo in the example/ directory to show how to use this package. Common file name patterns include: main.dart, example.dart or you could also use angel_relations.dart.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=1.19.0