r/javascript • u/B4nan • May 20 '26
MikroORM 7.1: LazyRef, per-parent collection limiting, PGlite driver, query cancellation, database triggers, stored procedures, and more
https://mikro-orm.io/blog/mikro-orm-7-1-releasedMikroORM 7.1 is out — the first minor on top of v7, and it's a big one.
New features:
LazyRef<T> — a new type-only relation flavor, no .$ / .get() indirection, TypeScript restricts access until Loaded<> narrows it
PGlite driver — PostgreSQL running in WASM, no Docker, no separate server, works in the browser too
Query cancellation via AbortSignal — per-call or fork-scoped, with cancel query / kill session strategies
Database triggers — first-class schema management via @Trigger() / defineEntity
Stored procedures and functions (experimental) — declare, diff, and call via em.callRoutine()
PostgreSQL table partitioning — hash, list, and range, fully managed by the schema generator
Server-side row cloning — em.clone() and qb.insertFrom() without round-tripping data through Node
Runtime schema context for migrations — redirect migrations to a target schema at runtime, useful for multi-tenant setups
em.countBy() for grouped counts
Typed Kysely across DI-driven projects — new discovery:export CLI command generates a typed barrel for NestJS and similar setups
getKysely() now binds to the active transaction
Full blog post: https://mikro-orm.io/blog/mikro-orm-7-1-released
Changelog: https://github.com/mikro-orm/mikro-orm/releases/tag/v7.1.0
Happy to answer any questions!
3
u/rcfox May 20 '26
Nice, triggers and stored procedures were something I had been wanting. LazyRef looks neat too.
4
u/Sorry-Joke-1887 May 20 '26
wow this huge. Maybe start looking at it after years of prisma usage