Prisma Integration

Integrate Prisma ORM into NestJS applications with audit-enabled data modeling.

1|1|Updated Feb 4, 2026
One-click install
npx skills add https://github.com/namnh240795/automation-with-claude-cli --skill prisma-integration
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: Prisma Integration
Source: https://github.com/namnh240795/automation-with-claude-cli/tree/main/skills/prisma-integration
Command: npx skills add https://github.com/namnh240795/automation-with-claude-cli --skill prisma-integration

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill helps NestJS projects integrate Prisma ORM by providing setup guidance, PrismaService usage, and schema/templates aligned with traceability-backend conventions.

Core Features & Use Cases

  • PrismaService integration: Provides a nest-friendly PrismaService wrapper to manage PrismaClient lifecycle.
  • AppModule configuration: Global configuration and provider wiring to expose Prisma across modules.
  • Audit-friendly data modeling: Guidance to add audit fields (created_at, updated_at, deleted_at and by fields) and soft-delete patterns.
  • Migration & tooling workflows: Standardized commands for prisma generate, prisma migrate, and Prisma Studio within a multi-service monorepo.

Quick Start

Install Prisma CLI and client, initialize Prisma, and scaffold a prisma schema. Then configure generator and datasource, generate the client, and wire PrismaService in a NestJS module. For example:

  • npm install prisma @prisma/client
  • npx prisma init
  • Define schema.prisma with a generator client and a Postgres datasource
  • npm run prisma:generate

Frequently Asked Questions about Prisma Integration

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I integrate Prisma ORM into a NestJS monorepo?

To integrate Prisma ORM into a NestJS monorepo, you install the CLI and client, initialize Prisma, define a PostgreSQL datasource in your schema, and wire a nest-friendly PrismaService into your AppModule for global provider access.

What is the best way to manage PrismaClient lifecycle in a NestJS application?

Managing PrismaClient lifecycle in a NestJS application is best handled by wrapping it in a custom PrismaService. This service connects to PostgreSQL, exposes the client across modules, and ensures clean database connection handling during application shutdown.

How do I add soft-delete and audit trails to a Prisma schema?

You add audit trails and soft-delete patterns to a Prisma schema by defining specific audit fields directly in your data models. This includes adding created_at, updated_at, and deleted_at timestamps alongside corresponding 'by' fields to track user modifications.

How do I run Prisma migrations and generate the client within a multi-service monorepo?

Running Prisma migrations and generating the client within a multi-service monorepo requires standardized tooling commands. You use npm run prisma:generate and prisma migrate workflows specifically configured for your apps/backend and libs directory structure.

Does Prisma integration with NestJS require a PostgreSQL datasource?

Yes, Prisma integration with NestJS following traceability-backend conventions requires a PostgreSQL datasource. You must configure this database connection in your schema.prisma file alongside the generator client block before generating the Prisma client.

When do I need to configure Prisma Studio for a NestJS monorepo?

You need to configure Prisma Studio for a NestJS monorepo when you want to visually inspect and manage your PostgreSQL database records. It operates as part of standardized tooling workflows alongside migrate and generate commands within your multi-service structure.