TypeScript ORM with DataMapper and ActiveRecord patterns
open sourceMITfree
TypeORM is an object-relational mapper for TypeScript and JavaScript, built with TypeScript support from the start for type-safe database models. It supports both the DataMapper and ActiveRecord patterns, a QueryBuilder for complex queries with joins, pagination and caching, and migrations with automatic generation. It works with MySQL, PostgreSQL, MariaDB, SQLite, Microsoft SQL Server, Oracle, CockroachDB, Google Spanner, SAP HANA and MongoDB, and runs in Node.js, browsers, Cordova, Ionic, React Native, NativeScript, Expo and Electron.
Problems it solves
- map TypeScript classes to database tables with type safety
- generate database migrations from my entity models in Node.js
- use one ORM for PostgreSQL in production and SQLite in tests
Features
- DataMapper and ActiveRecord patterns
- TypeScript-first, type-safe entities
- QueryBuilder with joins, pagination and caching
- migrations with automatic generation
- MySQL, PostgreSQL, MariaDB, SQLite, SQL Server, Oracle, CockroachDB, Spanner, SAP HANA and MongoDB
- runs in Node.js, browsers, React Native, Expo and Electron
Alternatives
The same job
These do what TypeORM does.
- Prisma ORM One schema. Every query type-safe.
- MikroORM TypeScript ORM for Node.js built on Data Mapper, Unit of Work and Identity Map
- Drizzle ORM Lightweight, type-safe TypeScript ORM for SQL databases
- Sequelize Feature-rich ORM for modern TypeScript and JavaScript
- sqlc Compile SQL to type-safe code