@mikro-orm/postgresql
7.2.11 · 20 Nov 2026MIT1.3M / weekRepositoryHomepagenpmAtom feed
5.9.8 is the newest release of 5.x.
In short
1 breaking19 new3 faster16 fixed
- Breaking
It is no longer possible to do
collection.add(...items)with a generic array - it only works with a tuple. The solution is to docollection.add(items)instead, which will type check and is also more performant (no array copies).
Release note
Bug Fixes
cli: fix using
npx --workspacewithmikro-orm-esmcli: improve success message of
schema:update/dropcommandscore: always compare boolean properties as booleans (c30c680), closes #3576
core: do not ignore
defaultoption in version propertiescore: do not ignore falsy version values like
0core: fix assigning objects to collections
core: fix changing 1:1 relations value (7b6e6f7), closes #3614
core: fix removing entities with complex composite keys (6d6e9f4), closes #3543
core: fix validation of EM param in
assign(6572a59), closes #3571core: hydrate
mapToPkproperties with the PK valuecore: improve entity path detection with SWC 1.3.4+
core: merge entity automatically via
em.create(E, {}, { managed: true })(24d206f), closes #3571core: propagate entity removal to collection properties
core: rework handling of orphan removal for 1:m collections (925c798), closes #3564
core: serialize embedded JSON properties correctly when used in inline embeddable (feef8b3), closes #3519
mongo: fix populating 1:1 owners from inverse side
query-builder: support top level
$notoperator in join condition
Features
core: add
defineConfighelpercore: add
em.refresh(entity)methodcore: add
em.upsert()method (#3525) (3285cdb), closes #3515core: add
MikroORMandOptionsexports to each driver packagecore: add the
offsetintoFindOneOptionscore: automatically detect
src/dist/buildfolders and adjust configurationcore: enable
persistOnCreateby defaultcore: maintain identity for the
Referencewrapper (da1a0ef), closes #3582core: provide
metaandpropon custom mapped type instance (c1251d0), closes #3538core: track changes on entity references
core: validate missing items in enum definition
core: validate missing types in
EntitySchemadefinition (0716566), closes #3603migrations: allow configuring snapshot name (4bbe355), closes #3562
mongo: do not expand array queries to
$inoperator when nested inside$eqpostgres: add
qb.distinctOn()supportquery-builder: validate modification of finalized QB (b23f015), closes #3534
schema: add ability to ignore specific column changes (#3503) (05fb1ce), closes #1904 #1904
schema: try to infer runtime default values automatically
sqlite: enable returning statements in both SQLite drivers
Performance Improvements
core: don't propagate serialization context to hidden relations
core: improve support for large collections
schema: improve schema inspection speed in SQL drivers
Type-level breaking changes
- Breaking
It is no longer possible to do
collection.add(...items)with a generic array - it only works with a tuple. The solution is to docollection.add(items)instead, which will type check and is also more performant (no array copies).
A whole project to check? Paste its package.json in the dependency check: every deprecated, outdated or vulnerable dependency, with what to upgrade to. Free, no account.