Mikro-ORM is a TypeScript-based object-relational mapping system that provides a unified persistence layer for Node.js applications. It translates TypeScript entities into relational or document-based database schemas, supporting a variety of engines including PostgreSQL, MySQL, MariaDB, MS SQL Server, SQLite, and MongoDB.
The project implements the data mapper pattern to decouple in-memory domain models from the database persistence layer. It utilizes a unit of work pattern to track entity changes in memory and commit them in a single coordinated database transaction.
The library covers comprehensive data storage and synchronization capabilities, including type-safe query building, versioned schema migrations, and request-scoped state management. It provides advanced data modeling for entity inheritance and polymorphic relations, along with tools for query performance monitoring, result caching, and global data filtering.
Command-line utilities are included for managing database migrations, seeding data, and exporting entity definitions from existing schemas.