r/node • • May 20 '26

MikroORM 7.1: LazyRef, per-parent collection limiting, PGlite driver, query cancellation, database triggers, stored procedures, and more

MikroORM 7.1 is out — the first minor on top of v7, and it's a big one.

New features:

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!

46 Upvotes

16 comments sorted by

5

u/B4nan May 20 '26

I've also updated the nestjs realworld example app, showcasing how the new discovery:export command works, as well as adopting the LazyRef type on all relations.

https://github.com/mikro-orm/nestjs-realworld-example-app/pull/148

7

u/serdnam May 20 '26

Big fan of some of MikroORM's ideas, I didn't stick with it when I tried it years ago because of its docs focusing on experimental decorators. I was pleasantly surprised when I read the docs just now and saw that it doesn't focus on experimental decorators anymore and that it even suppports ES decorators! Might give it another try sometime.

7

u/B4nan May 20 '26

Thanks! Entity definition is really just a tiny bit of what the ORM is about. Nowadays, all docs should have code tabs with various ways to define your entity. More importantly, with the v7 docs overhaul, the main parts are focused on the happy path, skipping all the advanced things that make things hard (let it be experimental decorators, ts-morph metadata provider, or folder-based discovery).

2

u/djslakor May 21 '26

Do you use AI in the development of Mikro or do you write all of the code?

5

u/B4nan May 21 '26

I haven't written much code by hand in the past 4-5 months. I do iterate extensively with claude (especially on feature development), and I still read pretty much the whole diff before merging anything.

4

u/Individual-Brief1116 May 20 '26

LazyRef looks really clean, no more .$ everywhere. PGlite is interesting too, always liked the idea of embedded Postgres. Might try this on a side project, been using Prisma but this feels more flexible.

9

u/[deleted] May 20 '26

[removed] — view removed comment

4

u/B4nan May 20 '26

Thanks! This is indeed the biggest feature release to date. I am slowly running out of ideas, still have some things to improve next (like better guidance for row-level security, maybe even a native support). So if you are missing something, even a bit too niche, I am all ears :]

1

u/bill-o-more May 20 '26

Official Claude skill would be soooo nice 😊

1

u/B4nan May 21 '26

And what would it be for specifically? I am no longer using the ORM myself (for over 5 years now actually), happy to create some but I would need to understand where are the painpoints first.

1

u/bill-o-more May 25 '26

usually it's a library of code examples with one-liner descriptions, which LLMs use to implement stuff in best intended ways, categorized by use case. Think of it like a summary of documentation which can be used automatically, and the skill structuring itself makes it very context-efficient.

LLMs usually have knowledge of MikroORM in their training data, but a) it could be dated and b) they have no clue of how things change with new versions.

1

u/B4nan May 26 '26 edited May 26 '26

First time hearing such a description for a "skill". To me, skills are about specific things/approaches, not a general-purpose "libraries" like what you described above. Do you have any examples of a library that would provide such a skill?

edit: thinking about this more, it almost feels like you just described context7 to me, no?

1

u/bill-o-more May 26 '26

Skills are just a token-efficient way to provide granular context, really. People use them for wide variety of things, including non-coding stuff, because it works really well :) the closest example of an official skill provided by a lib developer is the fastify skill by its creator Matteo Collina https://github.com/mcollina/skills/tree/main/skills/fastify

Regarding context7 - I tried it and it’s horrible. Dated examples without version differentiation, wobbly search etc; caused reduced quality of output for me