SDKActive

Flow AI Kit

Flow AI Kit: Everything you need to get building Comprehensive guides, step-by-step tutorials, and complete API reference to help you build, test, and deploy applications with AdonisJS Learn Start by preparing your environment, then follow the full hands-on tutorial from scratch Start here Guides Upgrade from v6 to v7 Screencasts Watch practical screencasts and learn AdonisJS through real, guided video lessons Adocasts Plus Production-ready full-stack components, premium packages, and AI tooling

Field note

What it does

Guides / Data Layer SQL ORM Start Guides Reference Roadmap Basics Routing Controllers HTTP context Middleware Request Response Body parser Validation File uploads Session URL builder Exception handling Debugging Static file server Frontend EdgeJS Inertia Transformers Type-safe API Client TanStack query Vite Data Layer SQL ORM Redis Auth Introduction Verifying user credentials Session guard Access tokens guard Basic auth guard Custom auth guard Social authentication Authorization Security Hashing Encryption CORS Securing SSR apps Rate limiting Core Concepts Application lifecycle Dependency injection Service providers Container services Codegen Barrel files Assembler hooks Scaffolding and codemods Extending AdonisJS Digging Deeper Cache Drive Emitter Health checks I18n Atomic locks Logger Mail Queues Server-Sent Events OpenTelemetry Command line Introduction Creating commands Command arguments Command flags Prompts Terminal UI Repl Testing Introduction API tests Browser tests Console tests Resetting state between tests Database assertions Test doubles Start Guides Reference Roadmap Basics Routing Controllers HTTP context Middleware Request Response Body parser Validation File uploads Session URL builder Exception handling Debugging Static file server Frontend EdgeJS Inertia Transformers Type-safe API Client TanStack query Vite Data Layer SQL ORM Redis Auth Introduction Verifying user credentials Session guard Access tokens guard Basic auth guard Custom auth guard Social authentication Authorization Security Hashing Encryption CORS Securing SSR apps Rate limiting Core Concepts Application lifecycle Dependency injection Service providers Container services Codegen Barrel files Assembler hooks Scaffolding and codemods Extending AdonisJS Digging Deeper Cache Drive Emitter Health checks I18n Atomic locks Logger Mail Queues Server-Sent Events OpenTelemetry Command line Introduction Creating commands Command arguments Command flags Prompts Terminal UI Repl Testing Introduction API tests Browser tests Console tests Resetting state between tests Database assertions Test doubles Lucid - SQL ORM This guide covers Lucid ORM, the official database ORM for AdonisJS. You will learn how to: Configure database connections Use the query builder and models Create migrations and define relationships Work with transactions and hooks Serialize models and generate test data Overview Lucid ORM is an Active Record ORM built on top of Knex and deeply integrated within the AdonisJS ecosystem. Unlike standalone ORMs that require extensive configuration, Lucid works seamlessly with AdonisJS features like the validator, authentication layer, caching, rate-limiting, and queues without any additional setup. Lucid simplifies database interactions by encapsulating common operations using language-specific objects and classes. It's built on top of Knex, which means you can express complex SQL queries using a JavaScript API when needed. Lucid supports multiple databases including MySQL, PostgreSQL, Turso, SQLite, and MSSQL. The class-based model system makes your code intuitive and type-safe, while built-in support for relationships lets you model complex data structures. The migration system provides version control for your database schema, and seeders and factories help you populate databases with test data.

Capabilities

Available capabilities

Tags

Tags

No tags filed yet.

Ways to use it

Ways to use it

No integrations filed yet.

Product features

Product features

Accessing the query builder from models

Auto-generated schema classes

Basic CRUD operations

Configuration

Creating a model

Creating your first migration

Lucid - SQL ORM

Pagination

Pretty printing queries during development

Schema generation rules

Using the query builder directly

Working with models