Usage with SQL Drivers
MikroORM supports several SQL databases. Install the driver package for your database:
Usage with SQLite
MikroORM supports SQLite through dedicated driver packages and a generic SqliteDriver that works with any SQLite library via Kysely dialects.
Usage with CockroachDB
MikroORM supports CockroachDB through the @mikro-orm/postgresql driver. CockroachDB is PostgreSQL wire-compatible, so most MikroORM features work out of the box. This guide covers configuration and the key differences you need to be aware of.
Usage with MongoDB
To use MikroORM with mongo database, do not forget to install @mikro-orm/mongodb dependency. Then call MikroORM.init() as part of bootstrapping your app:
Usage with NestJS
Installation
Usage with Next.js
This guide covers integrating MikroORM with Next.js, addressing the unique challenges that arise from Next.js's bundler environment. For a complete working example, see the nextjs-example-app repository.
Usage with AdonisJS
This guide covers integrating MikroORM with AdonisJS, replacing the default Lucid ORM with MikroORM's Unit of Work and Identity Map patterns. For a complete working example, see the adonis-example-app repository.
Usage with Jest
When testing your own code that uses Jest for the tests, and MikroORM for the database, there are some things to consider.
Usage with Vanilla JS
MikroORM can be used with vanilla JavaScript using the defineEntity helper or EntitySchema. Both approaches provide full functionality without requiring TypeScript or decorators.
Usage with transpilers
Babel
Usage with AdminJS
Installation