Implementing Soft Deletes in AdonisJS Lucid ORM
Learn how to implement soft deletes in AdonisJS Lucid ORM to prevent permanent data loss, manage trashed records, and handle unique constraint conflicts.
ReadMeFeed / Community knowledge
Real questions. Useful conversations. Find the people who know your stack.
Learn how to implement soft deletes in AdonisJS Lucid ORM to prevent permanent data loss, manage trashed records, and handle unique constraint conflicts.
Step‑by‑step guide to add, use, and verify soft deletes in AdonisJS Lucid ORM for both version 5 and 6, including migration, model changes, querying, restoring, and caveats.
Learn how to implement server-side pagination in AdonisJS using Lucid's paginate() method to prevent memory exhaustion and optimize API performance.
AdonisJS 5 Lucid paginate() runs COUNT(*) plus LIMIT/OFFSET. Cap perPage, coerce query strings, and verify query plans before shipping list endpoints.
Validate before opening a Lucid transaction, keep writes small, and map database constraint errors to predictable HTTP responses.
Use AdonisJS Lucid preload to fetch related records in one extra query instead of one per row.
Offset pagination in AdonisJS Lucid is trivial but degrades on large tables. Learn when to keep `paginate()` and when to hand-roll keyset cursors.
Learn how to use Lucid ORM's preload method in AdonisJS to eliminate N+1 queries, with a worked example, pagination tips, and trade-offs to consider.
Stop killing your database with N+1 queries. Learn how to use Lucid's preload mechanism in AdonisJS to fetch relationships efficiently and keep your application fast.