NestJS
docs.nestjs.com โบ recipes โบ prisma
Prisma | NestJS - A progressive Node.js framework
You're now able to send database queries with Prisma Client. If you want to learn more about building queries with Prisma Client, check out the API documentation. When setting up your NestJS application, you'll want to abstract away the Prisma Client API for database queries within a service.
Ultimate Guide: How To Use Prisma With NestJS
Very nice article! Iโve been meaning to play around with both NestJS and Prisma for a while. If I can make a suggestion for a follow up article, would be for pointer-based pagination and caching. Thanks for sharing. More on reddit.com
NestJS ORM (TypeORM vs Prisma)
MikroORM More on reddit.com
NestJS Entity and Prisma Client
As you know the Prisma client generates an interface representing your model (with all the properties). You can use this interface most of the time, but unfortunately not everywhere. Sometimes it's useful and necessary to have a class instead of an interface. For example with Nest's Swagger module, the type property is expecting a value that is available at runtime (it can be a class but not an interface). Another example is the @Exclude decorator that is quite powerful. If you don't use all that feel free to completely remove the class entity and use the Prisma interface instead. More on reddit.com
NestJS + Prisma.. confusion about DTOs and the generated types
Hey ๐, Tasin from Prisma here. Answer to your questions Sure many generated types can be used, but a manual DTO creation can't be avoided completely right? You're correct. In general, Prisma defines data types for your data layer. For DTOs in NestJS, you're typically defining the types for your application layer. There might be a strong overlap between the two, but they might not necessarily be a one-to-one mapping. I would personally suggest defining the DTOs manually. How are you managing this in your project: Any tricks on how I can avoid to now create all the DTOs manually for sending data back to the backend? Note that there are some libraries like this one that can help generate DTOs for you. Personally I just write them manually but feel free to use libraries like this. Usually they thought about everything in the docs, has this been forgotten as it's quite common to exclude fields or am I missing something? This is not currently supported by Prisma. There's a github feature request for this. Note that there are some workarounds in the prisma docs . How to elegantly omit a field like a password from your NestJS API For your use case, I would suggest omitting the field using the NestJS Class serialization interceptor instead of removing it at the service level. Here's a quick example of the remove password from the User object case. First, define a UserEntity and annotate the password field with Exclude() so the field is removed during serialization. import { Exclude } from 'class-transformer'; export class UserEntity { // If you have a Prisma `User` type with the same fields, this entity can `implement` the `User` type from '@prisma/client' if you want to reuse Prisma-generated types. id: string; firstName: string; lastName: string; @Exclude() // will remove this field during serialization password: string; constructor(partial: Partial) { Object.assign(this, partial); } } Let's say you have a UserService with a findAll and findOne method: @Injectable() export class UsersService { constructor(private prismaService: PrismaService) {} // These functions return the Prisma User types, with the password included. findOne(id: string): Promise { return this.prismaService.user.findUnique({ where: { id } }); } async findAll(): Promise { return this.prismaService.user.findMany({}); } } Inside the controller, you can define the corresponding route handlers like this: @Controller('users') export class UsersController { @Get(':id') async findOne(@Param('id') id: string) { return new UserEntity(await this.usersService.findOne(id)); } @Get() async findAll() { const users = await this.usersService.findAll(); return users.map((user) => new UserEntity(user)); } } You can globally bind the ClassSerializationInterceptor by adding this line to your main.ts async function bootstrap() { const app = await NestFactory.create(AppModule); app.useGlobalInterceptors(new ClassSerializerInterceptor(app.get(Reflector))); await app.listen(3000); } bootstrap(); Hope this helps! By the way, I'm currently writing a tutorial series about using NestJS and Prisma in the Prisma Blog . The first article shows how to create a basic CRUD REST API. We hope to cover a lot of topics (just like the use case you are talking about in this post) and show best practices in the upcoming articles. I would def suggest checking it out! More on reddit.com
NestJS Postgres Prisma Tutorial #1 - Getting Setup - YouTube
01:43:56
NestJS & Prisma Tutorial - YouTube
25:59
NestJS Prisma Tutorial - YouTube
NestJS + Prisma Deep Dive
Nest.js REST API with Prisma ORM, Neon Postgres - YouTube
51:42
NestJS + Prisma Deep Dive
npm
npmjs.com โบ package โบ nestjs-prisma
nestjs-prisma - npm
January 7, 2026 - Library and schematics to add Prisma integration to a NestJS application. Latest version: 0.27.0, last published: 7 months ago. Start using nestjs-prisma in your project by running `npm i nestjs-prisma`. There are 9 other projects in the npm registry using nestjs-prisma.
ยป npm install nestjs-prisma
Published ย Jan 07, 2026
Version ย 0.27.0
nestjs-prisma
nestjs-prisma.dev
nestjs-prisma
Easy Prisma support for your NestJS application.
Prisma
prisma.io โบ blog โบ nestjs-prisma-rest-api-7D056s1BmOL0
Build a REST API with NestJS, Prisma 7, PostgreSQL and Swagger
June 3, 2022 - Updated (July 2026): This tutorial has been fully revised for Prisma ORM 7 and NestJS 11. Prisma 7 is Rust-free and uses driver adapters, generates the Prisma Client into your project (instead of node_modules), and is configured through a prisma.config.ts file.
nestjs-prisma
nestjs-prisma.dev โบ docs โบ installation
Installation - nestjs-prisma
Easy Prisma support for your NestJS application.
Tomray
tomray.dev โบ nestjs-prisma
Ultimate Guide: How to use Prisma with NestJS - Tom Ray
November 29, 2022 - This will spin up a local instance of Prisma Studio (for me it opens on localhost:5555). Open this up in your browser and you'll see something like this: Go into the users and add a few mock users, then do the same with tweets! ... In order for the NestJS app to get and mutate data from the database we need to use Prisma Client.
DEV Community
dev.to โบ xavier_carreragimbert โบ setting-up-nestjs-with-prisma-without-the-headache--47n2
Setting Up NestJS with Prisma (Without the Headache) - DEV Community
November 24, 2025 - Iโm really glad it helped, Dennis! It should work fine without any major changes. Did you run into any issues while using Prisma 7? ... I tried to fix it, but it was too complicated for me. I decided to wait for the official sample to be updated: github.com/nestjs/nest/issues/15965
DEV Community
dev.to โบ nadim_ch0wdhury โบ how-to-use-nest-js-with-prisma-52c0
How to use Nest JS with Prisma? - DEV Community
February 6, 2025 - datasource db { provider = "postgresql" url = env("DATABASE_URL") } generator client { provider = "prisma-client-js" } model User { id Int @id @default(autoincrement()) name String email String @unique } ... Create a Prisma Module: Create a prisma directory inside src and add prisma.service.ts and prisma.module.ts files. Prisma Service: Create src/prisma/prisma.service.ts: import { Injectable, OnModuleInit, OnModuleDestroy } from '@nestjs/common'; import { PrismaClient } from '@prisma/client'; @Injectable() export class PrismaService extends PrismaClient implements OnModuleInit, OnModuleDestroy { async onModuleInit() { await this.$connect(); } async onModuleDestroy() { await this.$disconnect(); } }
GitHub
github.com โบ notiz-dev โบ nestjs-prisma-starter
GitHub - notiz-dev/nestjs-prisma-starter: Starter template for NestJS ๐ป includes GraphQL with Prisma Client, Passport-JWT authentication, Swagger Api and Docker
Prisma Client JS is a type-safe database client auto-generated based on the data model. ... Open up the example GraphQL queries and copy them to the GraphQL Playground. Some queries and mutations are secured by an auth guard.
Starred by 2.5K users
Forked by 366 users
Languages ย TypeScript 96.7% | JavaScript 1.8% | Dockerfile 1.3% | Shell 0.2%
White Prompt Blog
blog.whiteprompt.com โบ an-overview-of-nest-js-with-prisma-orm-56c74d3930af
An overview of Nest.js with Prisma ORM | by Daniel Brum | White Prompt Blog
September 23, 2022 - Nest.js is a consolidated and widely used framework on the Node.js environment for building applications and services. It also has great support and integration with a lot of different tools like ORMs, or Object-Relational Mapping, message queues, logging, and more. Prisma is a great ORM that has been gaining traction lately.
npm
npmjs.com โบ package โบ @nestjs-mod โบ prisma
@nestjs-mod/prisma - npm
Next-generation Node.js and TypeScript ORM for NestJS-mod (preview version only for Postgres). Latest version: 1.16.1, last published: a year ago. Start using @nestjs-mod/prisma in your project by running `npm i @nestjs-mod/prisma`. There are no other projects in the npm registry using @nestjs-mod/prisma.
ยป npm install @nestjs-mod/prisma
Published ย Jun 16, 2025
Version ย 1.16.1
nestjs-prisma
nestjs-prisma.dev โบ docs โบ examples
Examples - nestjs-prisma
Rust-free and driver adapter NestJS app with prisma-client (Rust-free), driver adapter and nestjs-prisma.