platform/packages/orm/angel_orm_service
2021-06-14 11:52:58 +08:00
..
example Add 'packages/orm/' from commit 'ceb58a25b58eeabeeab5a0bb6257f144e150dc24' 2020-02-15 18:22:15 -05:00
lib Add 'packages/orm/' from commit 'ceb58a25b58eeabeeab5a0bb6257f144e150dc24' 2020-02-15 18:22:15 -05:00
test Add 'packages/orm/' from commit 'ceb58a25b58eeabeeab5a0bb6257f144e150dc24' 2020-02-15 18:22:15 -05:00
analysis_options.yaml Add 'packages/orm/' from commit 'ceb58a25b58eeabeeab5a0bb6257f144e150dc24' 2020-02-15 18:22:15 -05:00
CHANGELOG.md Add 'packages/orm/' from commit 'ceb58a25b58eeabeeab5a0bb6257f144e150dc24' 2020-02-15 18:22:15 -05:00
LICENSE Updated license 2021-06-14 11:52:58 +08:00
mono_pkg.yaml Add 'packages/orm/' from commit 'ceb58a25b58eeabeeab5a0bb6257f144e150dc24' 2020-02-15 18:22:15 -05:00
pubspec.yaml Updated dart requirements to 2.10 2021-02-14 13:22:25 +08:00
README.md Add 'packages/orm/' from commit 'ceb58a25b58eeabeeab5a0bb6257f144e150dc24' 2020-02-15 18:22:15 -05:00

angel_orm_service

Pub build status

Service implementation that wraps over Angel ORM Query classes.

Installation

In your pubspec.yaml:

dependencies:
    angel_orm_service: ^1.0.0

Usage

Brief snippet (check example/main.dart for setup, etc.):

// Create an ORM-backed service.
  var todoService = OrmService<int, Todo, TodoQuery>(
      executor, () => TodoQuery(),
      readData: (req, res) => todoSerializer.decode(req.bodyAsMap));

  // Because we provided `readData`, the todoService can face the Web.
  // **IMPORTANT: Providing the type arguments is an ABSOLUTE MUST, if your
  // model has `int` ID's (this is the case when using `angel_orm_generator` and `Model`).
  // **
  app.use<int, Todo, OrmService<int, Todo, TodoQuery>>(
      '/api/todos', todoService);