prisma-repository

Bridge Prisma repositories to domain interfaces with mappers and dependency injection.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Este patrón facilita la creación de repositorios con Prisma a través de interfaces de dominio, promoviendo desacoplamiento entre dominio e infraestructura y facilitando pruebas y mantenimiento.

Core Features & Use Cases

  • Interfaz de repositorio (Domain) que define contratos para operaciones como findById, findByEmail, create, update y delete.
  • Implementación con Prisma que conecta las interfaces a la base de datos mediante PrismaService.
  • Mappers para convertir entre entidades Prisma y modelos de dominio.
  • Registro en el módulo para inyección de dependencias.

Quick Start

Configure un proyecto Prisma siguiendo el patrón de repositorio con interfaces y genera las capas dominio e infraestructura.

Frequently Asked Questions about prisma-repository

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

FAQPage Schema
How do I implement the repository pattern with Prisma and NestJS?

To implement the Prisma repository pattern, you define a domain interface for operations like findById and create, then build a Prisma implementation class that bridges those contracts to the database via PrismaService.

What is the best way to decouple Prisma entities from my domain models?

Decoupling Prisma entities from domain models is achieved using mappers that convert data between Prisma database records and your domain layer, ensuring separation of concerns between infrastructure and domain logic.

Why use a repository pattern in domain-driven design with Prisma?

Using a repository pattern in domain-driven design with Prisma promotes decoupling between your domain and infrastructure layers, which facilitates easier unit testing and long-term maintenance of data access logic.

Can I use TypeScript to define domain interfaces for Prisma repositories?

Yes, you can use TypeScript to define domain repository interfaces that specify contracts like findByEmail and update, then create Prisma implementations that fulfill these TypeScript interfaces for dependency injection.

How do I register Prisma repository implementations in a NestJS module?

You register Prisma repository implementations in a NestJS module by binding the domain repository interface to the concrete Prisma repository class, enabling dependency injection throughout the application.