angel_orm_service 1.0.0 copy "angel_orm_service: ^1.0.0" to clipboard
angel_orm_service: ^1.0.0 copied to clipboard

Service implementation that wraps over Angel ORM Query classes.

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);
0
likes
40
pub points
0%
popularity

Publisher

verified publisherangel-dart.dev

Service implementation that wraps over Angel ORM Query classes.

Repository (GitHub)
View/report issues

License

MIT (LICENSE)

Dependencies

angel_framework, angel_orm

More

Packages that depend on angel_orm_service