typeorm
Installation
SKILL.md
TypeORM — TypeScript ORM for SQL Databases
Overview
TypeORM maps TypeScript classes to database tables with decorators and gives you repositories, a QueryBuilder, transactions and a migration CLI on top. It supports PostgreSQL, MySQL/MariaDB, SQLite, SQL Server, Oracle, CockroachDB, SAP HANA, Spanner and MongoDB. This skill targets TypeORM 1.x (1.0 shipped in May 2026 and removed the APIs deprecated during 0.3); the 0.3 line still gets fixes under the npm legacy tag.
Instructions
Install and configure
npm install typeorm reflect-metadata
npm install pg # driver: pg, mysql2, better-sqlite3, mssql, oracledb or mongodb
npm install -D typescript@5 ts-node @types/node # ts-node runs the CLI against .ts files
npx typeorm init --name blog-api --database postgres # or scaffold: package.json, tsconfig.json, src/data-source.ts, src/entities/User.ts
tsconfig.json must set "experimentalDecorators": true and "emitDecoratorMetadata": true. All access goes through one DataSource instance — the global createConnection() / getRepository() helpers no longer exist.