TypeORM

A TypeScript/JavaScript ORM supporting both Active Record and Data Mapper, across more databases than any other JS ORM

Library
npm
v1.1.2
36,672 stars
MIT License

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum. How we score it →
88 /100 Excellent
Development Activity 92
Maintenance 84
Community 76
Maturity 60
Momentum 40

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation. How we score it →
78 /100 Good
Architecture 85
Code Quality 82
Innovation 76
Learning Curve 70

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 15 apps in this directory

TypeScript
100%
Other

Activepieces

AI Assistants · Automation · Mcp

25,408

Open-source AI automation platform that converts 280+ workflow integrations into MCP servers for LLMs, with no-code builders and TypeScript extensibility.

View details
92
Repo Health
85
Technical
64
Dependency
Built with
TypeScript 100%
Updated 1 weeks ago
TypeScript
72%
AGPL 3.0

APITable

Databases · Low Code Platforms

15,661

API-first collaborative spreadsheet-database platform that auto-generates REST APIs and lets teams build internal tools, CRMs, and dashboards without code.

View details
65
Repo Health
77
Technical
60
Dependency
Built with
TypeScript 72%
Java 22%
Updated 2 months ago
Rust
77%
MIT

Bun

Developer Tools

96,668

An all-in-one JavaScript and TypeScript toolkit — one Rust-and-JavaScriptCore binary that replaces Node.js, npm, a bundler, and a test runner with faster equivalents.

View details
92
Repo Health
91
Technical
64
Dependency
Built with
Rust 77%
C++ 12%
Updated 1 weeks ago
Go
80%
Apache 2.0

Dolt

Data Engineering · Databases · Developer Tools

24,838

The SQL database you can branch, merge, diff, and clone — Git for your data, MySQL-compatible and ready for multi-agent AI workflows.

View details
91
Repo Health
9
Technical
65
Dependency
Built with
Go 80%
Shell 19%
Updated 1 weeks ago
TypeScript
54%
MIT

FormBee

Forms Surveys

769

A self-hostable form backend that accepts HTML form submissions and routes them to email, Telegram, Discord, webhooks, and automation platforms — without writing any server-side code.

View details
39
Repo Health
48
Technical
70
Dependency
Built with
TypeScript 54%
SCSS 25%
HTML 19%
Updated 1 months ago
TypeScript
83%
Apache 2.0

Grist

Databases · No Code Platforms

12,062

A modern relational spreadsheet that combines Python-powered formulas, drag-and-drop dashboards, and granular access controls in a self-hostable, SQLite-backed data platform.

View details
91
Repo Health
93
Technical
63
Dependency
Built with
TypeScript 83%
Python 11%
Updated 1 weeks ago
TypeScript
98%
Other

Hexabot

AI Development · Automation

1,155

Build and run agentic workflows across channels with YAML, tools, and RAG

View details
80
Repo Health
76
Technical
65
Dependency
Built with
TypeScript 98%
Updated 1 weeks ago
TypeScript
94%
AGPL 3.0

Laudspeaker

Automation · Marketing

2,631

Open-source customer engagement platform for building visual, event-triggered messaging journeys across email, SMS, push, in-app, and webhooks.

View details
44
Repo Health
66
Technical
62
Dependency
Built with
TypeScript 94%
Updated 4 months ago
TypeScript
26%
AGPL 3.0

Omnivore

Bookmarks Archiving · Knowledge Management · Note Taking

16,408

Self-hosted read-it-later platform with highlights, newsletters, PDFs, and seamless Obsidian and Logseq integration.

View details
90
Repo Health
74
Technical
65
Dependency
Built with
TypeScript 26%
JavaScript 24%
HTML 20%
Updated 1 weeks ago

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers