undefined

Lucid

Lucid is AdonisJS' Object Relational Mapping (ORM). It's a first-party package that follows the active record pattern. With it you can easily perform CRUD operations, add database hooks, normalize data, and so much more.

12 Series
170 Lessons
Database

Lessons

Video preview
Video preview

Pagination

Learn pagination in AdonisJS. Split large datasets into pages to improve performance and user experience with Lucid paginate().

Video preview
Working with AdonisJS Relationships
Video preview

Working with Model Relationships

Learn the difference between eager and lazy loading relationships in AdonisJS. We'll also learn about querying nested relationships, filtering by relationships, and more.

Video preview
AdonisJS Query Builder
Video preview

Query Builder Basics

Learn how to build complex SQL queries with where clauses, selects, joins, and more using method chaining with Lucid's Model and Database Query Builder in AdonisJS.

Video preview
Factories & Seeders
Video preview

Factories & Seeders

Learn database seeders and factories in AdonisJS. Populate databases with preliminary data using factories and seeders.

Video preview
CRUD Operations
Video preview

CRUD Basics

Learn CRUD operations in AdonisJS. Create, read, update, and delete records using AdonisJS models and Lucid ORM.

Video preview
Models, Schema Classes, and Relationships in AdonisJS
Video preview

Models, Schema Classes, & Relationships

Learn AdonisJS models and generated schema classes. We'll discuss model hooks, getters, computed properties, relationships, and how models can use schema classes as a base to automatically keep model columns up-to-date with our database.

Video preview
Database Migrations
Video preview

Database Migrations

Learn database migrations in AdonisJS and how they can be used to scaffold and build upon our application's database. Track, share, and rollback database changes with version control for your schema.

Video preview
Piecing it all together
Video preview

Piecing It All Together

In this lesson, we'll piece everything we've learned thus far together and create functional tests for a route allowing the authenticated user to change their email. This encompasses authentication, email sending, database records, and more

Video preview
Testing Model Logic
Video preview

Testing Model Logic

In this lesson, we'll learn how to Unit Test AdonisJS Model logic using Japa. We'll test a password reset token's validity to show instance-level tests. Then, we'll test its generate and verify methods to show static methods.

Video preview
Testing with Lucid Model Factories
Video preview

Testing with Lucid Model Factories

In this lesson, we'll learn about AdonisJS Model Factories and how we can use them to create realistic, yet fake, test data. We'll create a few factories we'll use in this series and learn how we can stub or create data with them in tests.

Video preview
Database Driven Endpoints
Video preview

Testing Database-Driven Endpoints

In this lesson, we'll learn how to functionally test a registration endpoint using a test database. We'll learn about global transactions and how we can use them to easily reset our database between tests and confirm database state with Lucid.

Video preview
Database Hooks
Video preview

Database Test Runner Hooks

In this lesson, we'll learn how to set up a dedicated test database to ensure clean, isolated testing. We'll configure a separate SQLite database using a test environment variable and set up Japa runner hooks to automatically migrate and seed our database

Video preview
Meilisearch Index Ace CLI Command
Video preview

Creating a Command to Index Data in Meilisearch

In this lesson, we'll create an Ace CLI command to index our pre-existing data within our Meilisearch database so it is ready to search against. We'll walk our way through this and point out what to watch out for and how to view task errors.

Video preview
Seeding Fake Data
Video preview

Seeding Fake Data to Index for our Multi-Search

In this lesson, we'll create a database seeder that will utilize our model factories to generate plenty of fake data to index and search against. We'll also discuss how we can easily batch insert bulk data in a single call.

Video preview
Migrations, Models, and Factories
Video preview

Creating our Database Migrations, Models, and Factories

In this lesson, we'll work on structuring our database by defining our migrations, Lucid models, and model factories to aide in generating fake data we'll later index and search against with Meilisearch.

Video preview
What We'll Be Building
Video preview

What We'll Be Building

In this series, we'll be building a completely server-rendered multi-search using Meilisearch, Unpoly, and a little AlpinzeJS. We'll setup the open-source version of Meilisearch locally, setup seeders and factories to build fake data to index, and more!

Video preview
Globally Altering the Base Model
Video preview

How To Globally Alter Lucid's BaseModel

In this lesson, we'll discuss how we can globally alter Lucid's BaseModel to make global changes across all our application's models. We'll walk through globally changing the naming strategy and extras serialization as examples.

Video preview
Inspecting Lucid Queries
Video preview

Inspecting Lucid Queries for Index Analysis

In this lesson, we'll walk through how you can inspect specific or all Lucid queries within your AdonisJS application. We'll then use this to analyze a slow queries execution plan, determine an appropriate index to add, and add that index via a migration.

Showing 1 to 18 of 168 results