Vibeleaderboard
Index / tool

TypeORM

typeorm.io
Visit typeorm.io
Category
Developer Tools
Rank

Previous survey · No. 718 ·

Pricing
Open Source
Type
TOOL
Use case
Coding
Interfaces
SDK
Builder
typeorm
Latest release
1.1.2
Date

About

Classic decorator-based ORM. Mature TypeScript ORM with decorators, active record / data mapper patterns, and migrations. Common pick with NestJS.

What it does

TypeORM lets you write a JavaScript or TypeScript class with tags on its fields describing a database table, then treats instances of that class as rows you can create, load, and query directly. It runs against many different database engines through one shared programming interface, and the same code can target a browser, a mobile app, or a desktop shell built on web technology, not just a Node server. A bundled command-line tool scaffolds new projects and generates schema-change scripts from your class definitions.

Why it's ranked here

The verdict is positive on capability, with a real setup cost attached. Few libraries in this space claim support for as many databases at once, spanning full relational systems down to embedded and mobile drivers, and the same code runs in browsers, Cordova, Expo, and Electron apps as well as plain Node. That reach comes from a public interface exporting well over a hundred classes, decorators, and utilities: good for coverage, harder for a newcomer to find the entry point. Licensing is permissive and the command-line tool scaffolds a working project in minutes, even though the shim and compiler settings it needs are easy to miss on a first try.

What's good

The feature list is long because most of it is genuinely built in, not bolted on: eager and deferred relations, self-referenced and closure-table hierarchies, cascading writes, connection pooling, replication, and query result caching all ship in the core package. Schema-change scripts can be generated from entity edits instead of written from scratch. Choosing between a model that saves itself and a separate object that manages persistence for it is a real either-or, not one pattern with a workaround. Security issues get a private disclosure channel rather than public bug reports.

Tradeoffs

The convenience has strings attached. Decorated classes need a metadata shim loaded globally plus specific compiler settings turned on, which is easy to get wrong the first time. Mobile and hybrid platform support leans on outside plugins: the documented Cordova storage driver explicitly does not support transactions, a real gap if an app needs atomic writes. Generated schema-change scripts still need a human to read the SQL before running them, and the documentation itself warns against automatic schema syncing once real data exists. None of this is unusual for the category, but the sheer surface area gives setup more places to go wrong.

How to use it well

Reach for this when one codebase needs to run against more than one kind of database, or when the same data layer also has to power a mobile or embedded build. Use the command-line tool to scaffold the project and generate schema-change scripts, but read the generated SQL before applying it to real data, since the documentation warns against automatic schema syncing in production. Skip it for a single Postgres instance where a thin query builder would do: the decorator setup and the size of the interface are overhead you will not use.

Technical notes+

The public surface lives in packages/typeorm/src/index.ts, which re-exports well over a hundred symbols: every column and relation decorator, the full query-builder family, error types, migration classes, and utility helpers, all from one entry point. packages/typeorm/src/query-builder/index.ts wires up DeleteQueryBuilder, InsertQueryBuilder, SelectQueryBuilder, UpdateQueryBuilder, SoftDeleteQueryBuilder, and RelationQueryBuilder through a single registration function, and packages/typeorm/src/decorator/Index.ts shows how far the overload chasing goes: the Index decorator alone has seven distinct call signatures to stay backward compatible. packages/typeorm/src/error/index.ts exports dozens of narrow error classes (EntityNotFoundError, OptimisticLockVersionMismatchError, MissingPrimaryColumnError, and more) instead of one generic exception. packages/typeorm/src/cli.ts builds the command-line tool on yargs, registering separate command classes for init, entity and subscriber scaffolding, migration generate/run/revert/show, schema sync/drop/log, and cache clearing. package.json and pnpm-workspace.yaml confirm the repository is a pnpm-managed monorepo with packages living under packages/* plus a playground package, while the documentation site is deliberately excluded from the workspace as a separate build.

Observed

License
MIT (per LICENSE)
Language
TypeScript, with compiled JavaScript (ES2023) output
Packaging
Published to npm as the typeorm package; requires the reflect-metadata package as a companion dependency
Interfaces
Both a library API (DataSource, Repository, QueryBuilder) and a bundled command-line tool for init, migrations, and schema operations
Platform support
Node.js, browser (via an embedded SQL engine), Capacitor, Cordova/Ionic, Expo, NativeScript, and React Native
Database support
PostgreSQL, MySQL/MariaDB, SQLite, Microsoft SQL Server, Oracle, SAP HANA, MongoDB, CockroachDB, and Google Spanner
Repository structure
pnpm workspace monorepo with packages under packages/* plus a playground package; the documentation site is a separate, excluded Docusaurus build
Contribution requirements
CONTRIBUTING.md requires test cases with any pull request and routes security reports through private GitHub Security Advisories rather than public issues

Read from README.md, package.json, packages/typeorm/src/index.ts, packages/typeorm/src/data-source/index.ts, packages/typeorm/src/query-builder/index.ts, packages/typeorm/src/decorator/Index.ts, packages/typeorm/src/error/index.ts, packages/typeorm/src/cli.ts, docs/docs/getting-started.md, docs/docs/data-source/1-data-source.md, docs/docs/migrations/01-why.md, docs/docs/help/2-supported-platforms.md, CONTRIBUTING.md, LICENSE, pnpm-workspace.yaml.

Tags

TypeORMORM & Data Layer

Tech Stack

Node.js

Media

TypeORM

Comments (0)

No comments yet

Editorially curated, with community endorsements as a secondary signal. Corrections welcome.