v2 launch promo! Get a one-off 50% discount on PRO yearly using V2LAUNCHPROMO. Get started

Introduction to Lucid

Introduction to Lucid

46mins
13 lessons
Beginner
Start course

Lucid is AdonisJS ORM. In this course, I show you how to get started with Lucid in an AdonisJS 5 application.

Getting Started

1m 19s

We start of the course by looking at what Lucid is.

2m 29s

Lucid isn't installed out of the box in a fresh AdonisJS 5 application. So before we can start making use of it, we need to first install and set it up.

In this lesson, we look at what a Lucid model is and how to create one.

Lucid employs a convention over configuration approach. In this lesson, we go over some of the conventions and how to override them.

Though models are not tied to migrations, in this lesson, we cover how to create database tables using migrations.

Unlike in AdonisJS 4, we now need to define database table columns inside models. In this lesson, we cover how to define database table columns on models.

CRUD

Let's start performing some actual database operations. In this lesson, we cover inserting records into the database.

In this last lesson, we saw how to insert records into the database. Instead of having to go into the database to see created records, it will be nice if we can retrieve and display all the created posts directly in our application. Let's see how we can achieve that.

In this lesson, we cover how to retrieve a single record from the database. We look at two ways of achieving that.

In this lesson, we look at how Lucid implicitly handles when a record doesn't exist in the database.

In addition to the Lucid ORM, AdonisJS also has a query builder, which can be used with models. In this lesson, we look at how to make use of the query builder to perform complex database queries.

So far we have seen how to insert records in the database, retrieve records from the database. Now, let's see how to update a record in the database.

To complete the CRUD section, let's see how to delete record from the database.

*Course still in development. Do check back often for updates.

Chimezie Enyinnaya

Hi, I'm Chimezie Enyinnaya, your teacher.

I’m a self-taught software developer based in Lagos, Nigeria, with over 8 years of experience. In the last couple of years, I've been doing more teaching because I enjoy sharing my knowledge so that others can benefit from it. Come along as I teach you all I know about AdonisJS, Node.js, and JavaScript at large!