Why MikroORM?
A modern ORM that gets out of your way and lets you focus on your domain
Supported Databases
One API, multiple database backends
import React, { useState, useEffect, useRef, useCallback } from 'react'; import Layout from '@theme/Layout'; import Link from '@docusaurus/Link'; import useDocusaurusContext from '@docusaurus/useDocusaurusContext'; import useBaseUrl from '@docusaurus/useBaseUrl'; import CodeBlock from '@theme/CodeBlock'; import styles from './styles.module.css'; const features = [ { title: 'Unit of Work & Identity Map', docsUrl: 'docs/unit-of-work', icon: ( ), description: 'Automatic change tracking and batched queries. All changes are wrapped in implicit transactions when you call em.flush().', }, { title: 'Fully Type-Safe', docsUrl: 'docs/type-safe-relations', icon: ( ), description: 'Type-safe queries, populate hints, and entity operations. Even string-based filters and relations are validated at compile time.', }, { title: 'Multiple Entity Definition Styles', docsUrl: 'docs/defining-entities', icon: ( ), description: 'Choose your style: defineEntity with full type inference, decorators, or EntitySchema. No lock-in to a single approach.', }, { title: 'Filters & Soft Delete', docsUrl: 'docs/filters', icon: ( ), description: 'Global and entity-level query filters for multi-tenancy, soft deletes, and more. Applied automatically to every query.', }, { title: 'SQL & NoSQL', docsUrl: 'docs/usage-with-sql', icon: ( ), description: 'First-class support for MongoDB, PostgreSQL, MySQL, MariaDB, SQLite, libSQL, MS SQL Server, and more.', }, { title: 'Schema Management', docsUrl: 'docs/migrations', icon: ( ), description: 'Prototype with SchemaGenerator, version with Migrations, or introspect existing databases with EntityGenerator.', }, { title: 'Smart Populate & Loading', docsUrl: 'docs/populating-relations', icon: ( ), description: 'Type-checked populate hints with auto-joined loading strategies. Control exactly what gets loaded and how.', }, { title: 'Events & Lifecycle', docsUrl: 'docs/events', icon: ( ), description: 'Powerful event system with entity lifecycle hooks, onFlush events, and metadata-aware QueryBuilder.', }, { title: 'Seeding & Factories', docsUrl: 'docs/seeding', icon: ( ), description: 'Seed your database with realistic test data using entity factories. Define reusable blueprints and generate data for development and testing.', }, { title: 'First-Class Kysely Integration', docsUrl: 'docs/kysely', icon: ( ), description: 'Use Kysely\'s type-safe SQL query builder directly with your MikroORM entities. Full autocompletion for table and column names.', }, ]; const databases = [ { name: 'PostgreSQL', logo: 'img/databases/postgresql.svg', docsUrl: 'docs/usage-with-sql' }, { name: 'MySQL', logo: 'img/databases/mysql.svg', docsUrl: 'docs/usage-with-sql' }, { name: 'MariaDB', logo: 'img/databases/mariadb.svg', docsUrl: 'docs/usage-with-sql' }, { name: 'SQLite', logo: 'img/databases/sqlite.svg', docsUrl: 'docs/usage-with-sqlite' }, { name: 'MongoDB', logo: 'img/databases/mongodb.svg', docsUrl: 'docs/usage-with-mongo' }, { name: 'MS SQL', logo: 'img/databases/mssql.svg', docsUrl: 'docs/usage-with-sql#ms-sql-server-limitations' }, { name: 'libSQL', logo: 'img/databases/libsql.svg', docsUrl: 'docs/usage-with-sqlite#using-libsql--turso' }, { name: 'CockroachDB', logo: 'img/databases/cockroachdb.svg', docsUrl: 'docs/usage-with-cockroachdb' }, { name: 'Oracle', logo: 'img/databases/oracle.svg', docsUrl: 'docs/usage-with-sql#oracle-limitations' }, { name: 'Turso', logo: 'img/databases/turso.svg', docsUrl: 'docs/usage-with-sqlite#using-turso-embedded-database' }, { name: 'Cloudflare D1', logo: 'img/databases/cloudflare-d1.svg', docsUrl: 'docs/usage-with-sqlite#using-cloudflare-d1' }, { name: 'PGlite', logo: 'img/databases/pglite.svg', docsUrl: 'docs/usage-with-pglite' }, ]; function Feature({ title, icon, description, docsUrl }) { return (
{description}
); } function FeatureScroll() { const trackRef = useRef(null); const paused = useRef(false); useEffect(() => { const el = trackRef.current; if (!el) return; let animId; const speed = 0.4; const step = () => { if (!paused.current) { el.scrollLeft += speed; // seamless loop: when the first set scrolls away, reset if (el.scrollLeft >= el.scrollWidth / 2) { el.scrollLeft = 0; } } animId = requestAnimationFrame(step); }; animId = requestAnimationFrame(step); return () => cancelAnimationFrame(animId); }, []); const pause = useCallback(() => { paused.current = true; }, []); const resume = useCallback(() => { paused.current = false; }, []); return (Define entities your way, query with a clean type-safe API
Based on Data Mapper, Unit of Work, and Identity Map patterns. Build type-safe, performant database layers with minimal boilerplate.
A modern ORM that gets out of your way and lets you focus on your domain
One API, multiple database backends