Skip to content

Services

github-actions[bot] edited this page Apr 26, 2026 · 3 revisions

Services

@nestjs-crud/* ships four adapter services, one per supported ORM. They all extend CrudService from @nestjs-crud/core and follow the same WhereBuilder + QueryComposer + FetchHelper shape (see CONTRIBUTING.md — Adapter shape).

ORM matrix

ORM Service class Wiki page @Crud cache Logger hook
TypeORM TypeOrmCrudService ServiceTypeorm wired through DataSource cache yes
Drizzle DrizzleCrudService ServiceDrizzle not wired (cache at the service layer) yes
MikroORM MikroOrmCrudService ServiceMikroOrm not wired (use Result Cache) yes
Prisma PrismaCrudService ServicePrisma not wired (use Accelerate) yes

See Caching for the cache option details.

All four services give you:

  • The eight generated routes from @Crud()
  • @Override() for replacing any generated handler
  • A strict field allowlist (v2.0.0): unknown sort, filter, or search fields throw RequestQueryException
  • READ COMMITTED transactions wrapping updateOne, replaceOne, and deleteOne
  • An optional LoggerService constructor argument (see Logging)

Choosing an adapter

  • TypeORM: most mature ecosystem, full feature parity with v1. The default for greenfield Postgres or MySQL projects with class entities.
  • Drizzle: SQL-first and light, good when you care about type safety and bundle size.
  • MikroORM: Unit-of-Work + identity map; reach for it if active-record ergonomics suit your team.
  • Prisma: schema-first with a generated client. Pick this if you are already on the Prisma toolchain.

See also

Clone this wiki locally