nest-mikro-orm-service

Generate and modify NestJS service files for MikroORM CRUD operations and transactions.

3|2|Updated Nov 13, 2025
One-click install
npx skills add https://github.com/bloominggrace/create-fullstack-service --skill nest-mikro-orm-service
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: nest-mikro-orm-service
Source: https://github.com/bloominggrace/create-fullstack-service/tree/main/.cursor/skills/nest-mikro-orm-service
Command: npx skills add https://github.com/bloominggrace/create-fullstack-service --skill nest-mikro-orm-service

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill streamlines the creation and modification of NestJS service files that integrate with MikroORM, ensuring correct patterns for database interactions and reducing boilerplate code.

Core Features & Use Cases

  • CRUD Operations: Provides clear patterns for creating, reading, updating, and deleting entities using MikroORM's EntityManager.
  • Custom Repository Pattern: Guides on implementing and registering custom repositories for complex query encapsulation.
  • Transaction Management: Demonstrates both programmatic and decorator-based approaches for handling transactions.
  • Error Handling: Standardizes exception handling for common MikroORM errors like unique constraint violations and not found errors, mapping them to appropriate NestJS exceptions.
  • Use Case: When developing a new feature in a NestJS application that requires a new data entity, use this skill to generate the basic service structure, including CRUD methods and proper MikroORM integration.

Quick Start

Use the nest-mikro-orm-service skill to create a new NestJS service file for managing user entities with MikroORM.

Frequently Asked Questions about nest-mikro-orm-service

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

FAQPage Schema
How do I implement CRUD operations in a NestJS service using MikroORM?

NestJS MikroORM service CRUD operations use the EntityManager for creating, reading, updating, and deleting entities. You must adhere to specific method chaining for persistence and removal operations to ensure correct database interactions.

What is the best way to handle transactions in a NestJS MikroORM service?

Handling transactions in a NestJS MikroORM service can be done using both programmatic approaches and decorator-based patterns. These methods ensure atomic database operations and maintain data integrity during complex multi-step updates.

How do I map MikroORM errors to NestJS exceptions?

To map MikroORM errors to NestJS exceptions, standardize exception handling for common database issues like unique constraint violations and not found errors. This translates ORM errors into appropriate HTTP responses within your application context.

Can I use custom repositories in a NestJS MikroORM service for complex queries?

Yes, you can implement and register custom repositories in a NestJS MikroORM service. This pattern encapsulates complex query logic within dedicated repository classes, keeping your service files clean and maintaining separation of concerns.

Do I need specific method chaining for persisting and removing entities with MikroORM in NestJS?

Yes, MikroORM in NestJS requires adherence to specific method chaining for persistence and removal operations. Following these exact chaining patterns ensures that entities are correctly tracked and flushed to the database during CRUD operations.