What is a model?

A Model in AdonisJS is a representation of a database table. Models allow us to interact with the database, create relationships and manage returned data in one class.

Adonis uses Lucid which is an implementation of the Active Record Pattern for accessing the database. Active Record Pattern here means that database records can be accessed in memory and when saved, will update the database. So a Lucid model can be used as an Object Relational Mapper (ORM).

Get hands-on with 1200+ tech skills courses.