TypeScript ORM for Node.js that gives type-safe database access across PostgreSQL, MySQL, SQLite, MongoDB and other databases.
typeorm/typeorm
A TypeScript and JavaScript ORM for Node.js and other JS platforms, supporting both Active Record and Data Mapper patterns across many SQL and NoSQL databases.
- Stars
- 36,662
- Forks
- 6,697
- Open issues
- 713
- Last commit
- 15 hours ago
What is it?
TypeORM is an object-relational mapper that runs on Node.js, browsers, Cordova, Ionic, React Native, NativeScript, Expo, and Electron, and works with both TypeScript and JavaScript. You define entities as classes with decorators, then query and modify rows through repositories, the entity manager, or a QueryBuilder.
It covers the database Common Needs: relations (eager and lazy, one-to-many, many-to-many, self-referencing), transactions, migrations with automatic generation, connection pooling, replication, and query caching. Supported databases include PostgreSQL, MySQL/MariaDB, SQLite, Microsoft SQL Server, Oracle, SAP HANA, CockroachDB, Google Spanner, and MongoDB.
TypeORM lets you pick between the Active Record pattern, where entities carry their own save and find methods, and the Data Mapper pattern, where a repository handles persistence. Both can be used in the same project.
Key features
- 01Supports both Active Record and Data Mapper patterns.
- 02Works with PostgreSQL, MySQL/MariaDB, SQLite, SQL Server, Oracle, SAP HANA, and MongoDB.
- 03Provides relations, cascades, transactions, and eager or lazy loading.
- 04Includes migrations with automatic migration generation.
- 05Offers a QueryBuilder with joins and pagination for joined queries.
- 06Ships a CLI and supports both ESM and CommonJS.
Use cases
- Building a Node.js or TypeScript backend that stores data in PostgreSQL or MySQL.
- Writing a mobile or desktop app with React Native, Ionic, or Electron that needs a local SQL database.
- Managing schema changes over time with generated migrations in a larger enterprise application.
Topics
FAQ
- What is typeorm?
- A TypeScript and JavaScript ORM for Node.js and other JS platforms, supporting both Active Record and Data Mapper patterns across many SQL and NoSQL databases. TypeORM is an object-relational mapper that runs on Node.js, browsers, Cordova, Ionic, React Native, NativeScript, Expo, and Electron, and works with both TypeScript and JavaScript. You define entities as classes with decorators, then query and modify rows through repositories, the entity manager, or a QueryBuilder.
- Is typeorm free to use? What license does it have?
- typeorm is open source under the MIT license. Check the license terms before using it in commercial products.
- Is typeorm still maintained?
- Actively maintained. The last commit to typeorm was on Oct 20, 2026.
- What can I use typeorm for?
- Building a Node.js or TypeScript backend that stores data in PostgreSQL or MySQL. Writing a mobile or desktop app with React Native, Ionic, or Electron that needs a local SQL database. Managing schema changes over time with generated migrations in a larger enterprise application.
- Where can I get typeorm?
- The source code and installation instructions are on GitHub: https://github.com/typeorm/typeorm
Summary generated by AI from the project's README. GitHub stats refresh daily.
Related projects
A lightweight, headless TypeScript ORM for PostgreSQL, MySQL and SQLite that works across Node.js, Bun, Deno and edge runtimes.
A promise-based Node.js and TypeScript ORM for PostgreSQL, MySQL, MariaDB, SQLite, MS SQL Server, Snowflake, Oracle and Db2.
Cross-platform SQL editor and database manager for Linux, macOS, and Windows, supporting MySQL, PostgreSQL, SQLite, SQL Server and many more.
A CLI and Go library for managing database schema changes through versioned SQL files or Go functions.
A keyboard-driven terminal UI for connecting to and querying many SQL databases, inspired by lazygit.