platform/angel_orm_service
2019-04-20 17:34:14 -04:00
..
example orm_service preview 2019-04-20 14:45:41 -04:00
lib orm_service tests 2019-04-20 17:30:48 -04:00
test orm_service tests 2019-04-20 17:30:48 -04:00
analysis_options.yaml orm_service preview 2019-04-20 14:45:41 -04:00
CHANGELOG.md orm_service readme 2019-04-20 15:45:42 -04:00
LICENSE orm_service tests 2019-04-20 17:30:48 -04:00
mono_pkg.yaml orm_service preview 2019-04-20 14:45:41 -04:00
pubspec.yaml orm_service readme 2019-04-20 15:45:42 -04:00
README.md orm_service 1.0.0 2019-04-20 17:34:14 -04: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);