Using Lucid outside AdonisJS: would small decoupling contributions be welcome? #5166
KevinBlakeLopez
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Hi! I'm working on Adonis' Nest, a batteries-included distribution for NestJS. The goal is a cohesive stack for NestJS applications, assembled from reusable, well-maintained packages instead of new infrastructure. We would like Lucid to be its persistence layer, and possibly to use other AdonisJS packages where they fit.
What we think it could offer AdonisJS:
What we are not asking for. We are not asking you to rewrite Lucid, to support NestJS, or to change anything for AdonisJS users. We'd like to know whether small, incremental contributions that you would be comfortable maintaining are welcome.
Where we are. Lucid 22.4.2 already runs standalone in our PostgreSQL test harness. The couplings we found are small:
@adonisjs/coreat runtime, for health checks;Application;@adonisjs/coreis a required peer.We have also opened lucid#1202 and pull request #1203, a fix for the isolation level being ignored in manual transactions (lucid#1006).
We know standalone use has been asked about many times (for example lucid#493, lucid#695 and discussion #4359), and that the answer has changed over the years. We saw "a truly standalone module" in the AdonisJS 7 roadmap (June 2025). We also saw the 2026 docs note suggesting Drizzle or Prisma outside AdonisJS, because most of Lucid's value comes from framework integration. We agree, and that integration is the part we would build and maintain on the NestJS side. We'd rather ask than guess:
@adonisjs/core? One example: optional logger and emitter parameters with no-op defaults.Database,BaseModel.useAdapter()andMigrationRunner(which your docs already show for programmatic use) stable public APIs when used outside an AdonisJS application? With the model and schema classes, they are what an integration would build on.Separately, we opened lucid#1205 for a transaction-outcome bug that affects AdonisJS applications too.
Thanks for your time, and for Lucid.
Kevin Blake Lopez
All reactions