platform/packages/orm/angel_orm_service
2024-10-12 03:39:20 -07:00
..
example Refactor: changing namespace, imports, re-branding 2024-10-12 03:35:14 -07:00
lib Refactor: changing namespace, imports, re-branding 2024-10-12 03:39:20 -07:00
test Refactor: changing namespace, imports, re-branding 2024-10-12 03:35:14 -07: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 anlyzer warnings 2024-06-24 07:54:16 +08:00
LICENSE Updated linter 2021-12-20 12:25:43 +08:00
pubspec.yaml Refactor: changing namespace, imports, re-branding 2024-10-12 03:35:14 -07:00
README.md Refactor: changing namespace, imports, re-branding 2024-10-12 03:35:14 -07:00

Protevus ORM Service

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

Service implementation that wraps over Protevus 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);