-
Notifications
You must be signed in to change notification settings - Fork 51
API: Database Operations with Objection.js
The Objection.js documentation is very extensive; if you think there should be an elegant way to do something there probably is.
There are models and schemas defined with many useful functions available.
The models should define any relations that are present so that they can be loaded using.
There is a _model.js class that all models should extend with some additional functionality like parsing the model to JSON and back in an ember friendly way, and for hiding fields which should not be exposed.
The schemas are used for validation of JSON and models, they will be more or less the same but may have differences. The schemas are included in the Objection.js models for validating input. And they can be used for testing the response of the API using mocha.