typeorm

Define TypeORM entities, configure data sources, and manage migrations in TypeScript.

3|Updated Jun 12, 2026
One-click install
npx skills add https://github.com/whimzyLive/nightshift-ai --skill typeorm-whimzylive
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: typeorm
Source: https://github.com/whimzyLive/nightshift-ai/tree/main/skills/typeorm
Command: npx skills add https://github.com/whimzyLive/nightshift-ai --skill typeorm-whimzylive

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires typeorm, and includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill simplifies the process of defining TypeORM entities, writing migrations, and building repository/query-builder code in TypeScript, providing a comprehensive guide for database design and application architecture.

Core Features & Use Cases

  • Entity Definition: Offers guidelines for creating entities with decorators, column definitions, and relation types.
  • Data Source Configuration: Provides instructions for setting up database connections and configuring data sources.
  • Repository Pattern: Details the usage of repositories, custom repositories, and query builders.
  • Migrations: Explains how to create and manage database migrations for schema changes.
  • Transactions: Describes how to handle transactions in TypeORM for atomic operations.
  • NestJS Integration: Shows how to integrate TypeORM with NestJS for building robust applications.
  • Best Practices: Offers advice on using migrations, eager vs. lazy loading, avoiding N+1 queries, and more.
  • Common Mistakes: Highlights common pitfalls and their solutions to prevent errors in TypeORM development.

Quick Start

Use the typeorm skill to define a new entity with TypeScript decorators and set up a database connection.

Frequently Asked Questions about typeorm

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

FAQPage Schema
How do I define TypeORM entities with TypeScript decorators?

To define TypeORM entities, use TypeScript decorators to map classes to database tables and specify column definitions. This approach provides a structured way to design your database schema directly within your object models.

What is the best way to manage database migrations in TypeORM?

The best way to manage database migrations in TypeORM is to create explicit migration files for schema changes. This practice ensures your database schema evolves safely and remains synchronized across different deployment environments.

How do I configure a TypeORM data source for a database connection?

Configuring a TypeORM data source involves setting up database connection parameters in your application. This setup establishes the underlying communication bridge required to execute repository patterns and query builder operations.

Can I integrate TypeORM with NestJS for application architecture?

Yes, you can integrate TypeORM with NestJS to build robust applications. This combination leverages TypeScript to provide a modular structure for database design, repository management, and handling atomic transactions.

How do I avoid N+1 queries and handle transactions in TypeORM?

To avoid N+1 queries in TypeORM, use the query builder to join relations efficiently or manage eager versus lazy loading appropriately. For atomic operations, wrap multiple database actions within explicit transaction boundaries.

Why does my TypeORM repository return unexpected query results?

Unexpected TypeORM repository query results often stem from common mistakes like improper relation mapping or misconfigured eager loading. Review your entity definitions and utilize custom repositories to enforce correct query builder operations.