platform/packages/orm/angel_orm_service
2024-06-23 18:02:36 +08:00
..
example Fixed dependencies 2024-06-23 18:02:36 +08:00
lib Updated pubspec 2022-08-29 01:51:56 +08:00
test Fixed dependencies 2024-06-23 18:02:36 +08:00
analysis_options.yaml Updated linter 2021-12-20 12:25:43 +08:00
AUTHORS.md Published angel_orm_mysql 2021-06-18 18:15:23 +08:00
CHANGELOG.md Fixed dependencies 2024-06-23 18:02:36 +08:00
LICENSE Updated linter 2021-12-20 12:25:43 +08:00
melos_angel3_orm_service.iml Added melos 2022-03-19 09:37:28 +08:00
pubspec.yaml Fixed dependencies 2024-06-23 18:02:36 +08:00
README.md Updated repository links 2023-12-25 11:45:10 +08:00

Angel3 ORM Service

Pub Version (including pre-releases) Null Safety Gitter License

Service implementation that wraps over Angel3 ORM Query classes.

Installation

In your pubspec.yaml:

dependencies:
    angel3_orm_service: ^8.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);