TypeORM
A TypeScript/JavaScript ORM supporting both Active Record and Data Mapper, across more databases than any other JS ORM
Repository Health
Technical Analysis
TypeORM is an ORM that runs in Node.js, browsers, Cordova, Ionic, React Native, NativeScript, Expo, and Electron, usable with either TypeScript or modern JavaScript. It supports more databases than any other JS/TS ORM — MySQL/MariaDB, Postgres, CockroachDB, SQLite, Microsoft SQL Server, Oracle, SAP HANA, Google Spanner, and MongoDB — through a common driver architecture.
Unlike most JavaScript ORMs, TypeORM supports both the Active Record and Data Mapper patterns side by side, letting teams choose the style that fits their codebase. It ships with entities/decorators, an entity manager and repositories, a full migration system, connection pooling and replication, a fluent QueryBuilder, and hooks (listeners/subscribers), drawing heavy influence from Hibernate, Doctrine, and Entity Framework.
What You Get
- A common driver layer spanning MySQL/MariaDB, Postgres, CockroachDB, SQLite, SQL Server, Oracle, SAP HANA, Google Spanner, and MongoDB
- Both Active Record and Data Mapper patterns, selectable per project rather than locked in by the library
- Decorator-based entity/column/relation definitions plus an alternative entity-schema (non-decorator) API
- A CLI for generating and running database migrations, including automatic migration generation from entity diffs
- A fluent QueryBuilder for complex joins, pagination, and cross-database/cross-schema queries
Common Use Cases
- Building a Node.js/NestJS backend that needs a full-featured ORM with migrations and relations across a relational database
- Standardizing data access across a codebase that must support multiple database engines (e.g. Postgres in prod, SQLite in tests)
- Modeling complex domain relations (eager/lazy, self-referenced, closure-table) that simpler query builders don’t support natively
- Migrating an existing Active Record-style codebase to TypeORM without switching to a Data Mapper architecture (or vice versa)
Under The Hood
Architecture - the src/ tree separates concerns cleanly: driver/ implements the per-database adapter layer, query-builder/ and query-runner/ handle SQL generation and execution, metadata-builder//metadata-args//metadata/ build the entity/column/relation reflection model from decorators, schema-builder/ derives and applies schema/migrations, and entity-manager//repository/ expose the Data Mapper API while persistence/ backs the Active Record BaseEntity methods. Tech Stack - TypeScript targeting Node.js, browser, and mobile runtimes (Cordova/Ionic/React Native/NativeScript/Expo/Electron), built with gulp, tested via a pnpm workspace, and using Stryker for mutation testing (stryker.config.json) alongside SonarCloud for coverage reporting. Code Quality - the test/ directory contains roughly 2,700 TypeScript test files split into functional, unit, core, and github-issues regression suites, with a docker-compose.yml spinning up real database instances for integration testing rather than relying solely on mocks — a strong signal for an ORM where driver-specific SQL dialect bugs are easy to miss. API Design - decorator-based entities (@Entity, @Column, @OneToMany) keep model definitions declarative and close to the class they describe, while the dual Active Record/Data Mapper support means the public API intentionally offers two idiomatic entry points (entity.save() vs repository.save(entity)) rather than forcing one pattern on all consumers.
Used by 16 apps in this directory
Omnivore
Bookmarks Archiving · Knowledge Management · Note Taking
Self-hosted read-it-later platform with highlights, newsletters, PDFs, and seamless Obsidian and Logseq integration.
OneUptime
Monitoring
The complete open-source observability platform that replaces PagerDuty, Datadog, Sentry, and StatusPage with a single self-hostable system.
Plasmic
CMS · Design Tools · Low Code Platforms
The open-source visual builder that lets teams design React apps and websites with drag-and-drop while integrating seamlessly with your codebase.
Swetrix
Analytics
Privacy-first, cookieless web analytics with error tracking, session replays, and performance monitoring — self-host or use Cloud.
ToolJet
AI Agents · Low Code Platforms · No Code Platforms
Open-source AI-native platform to build and deploy internal tools, workflows, and AI agents with a visual drag-and-drop builder and 80+ data source integrations.
Trench
Analytics · Data Engineering · Monitoring
Open-source event tracking infrastructure built on Kafka and ClickHouse that handles thousands of events per second on a single node, with full Segment API compatibility and no cookies.
twenty
CRM
The open-source CRM you build, ship, and version like the rest of your stack — with customizable objects, AI agents, and a TypeScript SDK.