.. | ||
example | ||
lib | ||
test | ||
analysis_options.yaml | ||
AUTHORS.md | ||
CHANGELOG.md | ||
LICENSE | ||
pubspec.yaml | ||
README.md |
Protevus ORM Service
Service implementation that wraps over Protevus ORM Query classes.
Installation
In your pubspec.yaml
:
dependencies:
protevus_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);