prisma

Manage Prisma migrations, mappers, and data cleaning in NestJS services.

Updated Dec 26, 2025
One-click install
npx skills add https://github.com/JoyanLabs/template-nestjs-dashboard-better_auth --skill prisma-joyanlabs
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: prisma
Source: https://github.com/JoyanLabs/template-nestjs-dashboard-better_auth/tree/main/skills/prisma
Command: npx skills add https://github.com/JoyanLabs/template-nestjs-dashboard-better_auth --skill prisma-joyanlabs

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes assets (resource) components.

What problem does it solve?

Prisma integration in NestJS can involve repetitive boilerplate for migrations, data conversion, and PrismaClient lifecycle management. This pattern provides a standardized approach to manage migrations, map Prisma results to domain models, and safely prepare data for Prisma operations.

Core Features & Use Cases

  • Migration patterns: guidance to use prisma migrate dev/deploy and generate clients in a consistent way.
  • Data mapping: utilities to convert between Prisma types and domain entities.
  • Safe data handling: cleanPrismaData utility to remove undefined values before updates.
  • Transactions: examples for batch and interactive transactions to ensure data integrity.
  • Use Case: Building a NestJS service that persists users via Prisma with type-safe input.

Quick Start

Install dependencies, integrate PrismaService, and start using the provided mappers and utilities to implement data access.

Frequently Asked Questions about prisma

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

FAQPage Schema
How do I manage Prisma migrations in a NestJS application?

Prisma migrations in a NestJS application are managed by consistently using prisma migrate dev and deploy commands to generate clients and apply schema changes. This pattern provides standardized guidance for executing these workflows safely across your service layers.

What is the best way to map Prisma types to domain entities in NestJS?

Mapping Prisma types to domain entities in NestJS is handled using specialized data mapping utilities. These mappers convert raw Prisma results into domain models, ensuring strong type safety and clean separation between your database layer and business logic.

How do I remove undefined values before Prisma updates in NestJS?

Removing undefined values before Prisma updates in NestJS is achieved using the cleanPrismaData utility. This safe data handling function strips undefined properties from your objects to prevent accidental field overwrites during CRUD operations.

Does this Prisma NestJS pattern support interactive transactions?

Yes, this Prisma NestJS pattern supports both batch and interactive transactions to ensure data integrity. It provides concrete examples for implementing transactional operations safely within your NestJS services.

Do I need a specific PrismaService setup for NestJS connection management?

Yes, you need a dedicated PrismaService for NestJS connection management and PrismaClient lifecycle control. This pattern includes a PrismaService implementation to handle database connections and exports utility functions for safe CRUD operations.