TypeORM
Feature-rich ORM for TypeScript and JavaScript supporting Active Record and Data Mapper patterns with decorators.
Overview
The framework supports PostgreSQL, MySQL, MariaDB, SQLite, MS SQL Server, Oracle, and MongoDB. It provides a powerful QueryBuilder for complex queries, supports eager and lazy relations, and includes a migration system that can auto-generate migrations from entity changes. Your AI agent can navigate these features to build robust data access layers.
TypeORM is widely used in NestJS applications where its decorator-based approach aligns with NestJS's own patterns. Your AI agent can set up the TypeORM module, define entities with validations, create custom repositories, and implement database transactions for complex business logic.
Who Is This For?
- NestJS developers building enterprise-grade backend services
- Teams preferring decorator-based entity definitions for database models
- Developers needing Active Record pattern for rapid prototyping
- Projects requiring support for multiple database engines simultaneously
Installation
npm install typeorm reflect-metadata pg
npm install -D @types/node
Claude Code generates entities and migrations via bash Configuration
// data-source.ts
import { DataSource } from "typeorm";
export const AppDataSource = new DataSource({
type: "postgres",
host: "localhost",
port: 5432,
username: "dev",
password: "dev",
database: "myapp",
entities: ["src/entities/*.ts"],
migrations: ["src/migrations/*.ts"],
synchronize: false,
}); Explore AI Tools
Discover the best AI tools that complement your skills
Read AI & Design Articles
Tips and trends in the world of design and AI
Related Servers
Linear MCP Server
Manage Linear issues, projects, and workflows directly from your AI coding agent without leaving the terminal.
Playwright MCP
Automate browser interactions and run end-to-end tests through the Model Context Protocol, enabling AI agents to verify UI behavior in real browsers.
Jest Test Runner
Run, debug, and analyze Jest test suites directly from your AI agent. Quickly identify failing tests and get suggested fixes.