概要
ORM for TypeScript and JavaScript. Supports MySQL, PostgreSQL, MariaDB, SQLite, MS SQL Server, Oracle, SAP Hana, WebSQL databases. Works in NodeJS, Browser, Ionic, Cordova and Electron platforms. - typeorm/typeorm
What is TypeORM?
TypeORM is an Object-Relational Mapping (ORM) tool that runs on NodeJS, Browser, Cordova, PhoneGap, Ionic, React Native, NativeScript, Expo, and Electron platforms. It supports both TypeScript and JavaScript (ES2021) and provides additional features that help you develop any kind of application that uses databases.
How to use TypeORM?
TypeORM supports both DataMapper and ActiveRecord patterns. You can write high-quality, loosely coupled, scalable, and maintainable applications using TypeORM. It provides features such as entities and columns, database-specific column types, entity manager, repositories and custom repositories, clean object-relational model, associations (relations), and more.
Features of TypeORM
- Supports both DataMapper and ActiveRecord patterns
- Entities and columns
- Database-specific column types
- Entity manager
- Repositories and custom repositories
- Clean object-relational model
- Associations (relations)
- Eager and lazy relations
- Uni-directional, bi-directional, and self-referenced relations
- Supports multiple inheritance patterns
- Cascades
- Indices
- Transactions
- Migrations and automatic migrations generation
- Connection pooling
- Replication
- Using multiple database instances
- Working with multiple database types
- Cross-database and cross-schema queries
- Elegant-syntax, flexible and powerful QueryBuilder
- Left and inner joins
- Proper pagination for queries using joins
- Query caching
- Streaming raw results
- Logging
- Listeners and subscribers (hooks)
- Supports closure table pattern
- Schema declaration in models or separate configuration files
- Supports MySQL, MariaDB, Postgres, CockroachDB, SQLite, Microsoft SQL Server, Oracle, SAP Hana, sql.js, and MongoDB NoSQL database
- Works in NodeJS, Browser, Ionic, Cordova, React Native, NativeScript, Expo, and Electron platforms
- TypeScript and JavaScript support
- ESM and CommonJS support
- Produced code is performant, flexible, clean, and maintainable
- Follows all possible best practices
- CLI
Price
TypeORM is open-source and free to use.