typeorm
Guidelines for developing with TypeORM, a full-featured ORM for TypeScript and JavaScript supporting multiple databases
Security Assessment
About typeorm
This skill is a development guidelines reference for TypeORM, the full-featured ORM for TypeScript and JavaScript that supports multiple databases. It solves the problem of writing correct, idiomatic data-access code by codifying entity definitions, relationships, repository usage, query building, and data-source configuration, with a stated focus on the Data Mapper pattern and enterprise application architecture. It is a documentation-only SKILL.md with abundant code examples and no executable scripts.
The guide opens with core principles (Active Record vs Data Mapper support, decorator-based entities, broad database support across MySQL, PostgreSQL, SQLite, SQL Server, Oracle, and more, and cross-runtime support) and required tsconfig settings (`experimentalDecorators`, `emitDecoratorMetadata`, strict mode). It then demonstrates entity definitions with primary-key options, column decorators (including JSON, enum, soft-delete, and version columns), and the three relationship types (one-to-one, one-to-many/many-to-one, many-to-many) with join configuration. Repository-pattern examples cover find variants, create/save/update/delete, soft delete, custom repository classes, and the query builder for joins, aggregates, and batch inserts. A data-source configuration section shows a Postgres `DataSource` set up from environment variables.
Target users are TypeScript and Node.js developers building database-backed applications who want a consistent, example-driven TypeORM reference. Use cases include modeling entities and relationships, writing repository and query-builder code, configuring migrations and data sources, and following enterprise-oriented conventions.
FAQ
Which databases and runtimes does TypeORM support per this guide?
It supports MySQL, PostgreSQL, MariaDB, SQLite, MS SQL Server, Oracle, and more, and runs in Node.js, the browser, Ionic, Cordova, React Native, NativeScript, Expo, and Electron.
What TypeScript configuration is required?
The guide requires `experimentalDecorators` and `emitDecoratorMetadata` enabled, `strict` mode, and settings such as `target: ES2020`, `module: commonjs`, and `moduleResolution: node`.
Does it cover relationships and soft deletes?
Yes. It shows one-to-one, one-to-many/many-to-one, and many-to-many relationships with join configuration, plus soft deletes via `@DeleteDateColumn` and `softDelete`, and optimistic locking via `@VersionColumn`.
How are credentials handled in the data-source example?
The example `DataSource` reads connection settings such as host from environment variables (for example `process.env.DB_HOST`), which is standard configuration practice rather than hardcoding secrets.
Is this executable code or reference material?
It is reference material: a single SKILL.md of guidelines and code examples that you adapt into your own project, not a runnable tool.
Install typeorm
Quick Setup:
- Copy the skill folder to
.claude/skills/ - Claude will automatically detect and use the skill
Repository
mindrally/skills