Skip to content

Releases: mikro-orm/mikro-orm

v5.5.0

23 Oct 22:01

Choose a tag to compare

5.5.0 (2022-10-23)

Bug Fixes

  • cli: fix using npx --workspace with mikro-orm-esm (#3560) (64777af)
  • cli: improve success message of schema:update/drop commands (11d0fd9)
  • core: always compare boolean properties as booleans (c30c680), closes #3576
  • core: do not ignore default option in version properties (1572008)
  • core: do not ignore falsy version values like 0 (754d672)
  • core: fix assigning objects to collections (#3628) (82a9708)
  • 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 #3571
  • core: hydrate mapToPk properties with the PK value (559ae28)
  • core: improve entity path detection with SWC 1.3.4+ (#3568) (9a2cb8c)
  • core: merge entity automatically via em.create(E, {}, { managed: true }) (24d206f), closes #3571
  • core: propagate entity removal to collection properties (25c1c06)
  • 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 (25ee03a)
  • query-builder: support top level $not operator in join condition (#3609) (047504f)

Features

  • core: add defineConfig helper (#3500) (67d3c68)
  • core: add em.refresh(entity) method (#3522) (dbe8aa4)
  • core: add em.upsert() method (#3525) (3285cdb), closes #3515
  • core: add MikroORM and Options exports to each driver package (#3499) (b68ed47)
  • core: add the offset into FindOneOptions (#3574) (9d5d457)
  • core: automatically detect src/dist/build folders and adjust configuration (#3497) (a8c8baf)
  • core: enable persistOnCreate by default (8424976)
  • core: maintain identity for the Reference wrapper (da1a0ef), closes #3582
  • core: provide meta and prop on custom mapped type instance (c1251d0), closes #3538
  • core: track changes on entity references (#3521) (0fb17bb)
  • core: validate missing items in enum definition (659c2de)
  • core: validate missing types in EntitySchema definition (0716566), closes #3603
  • migrations: allow configuring snapshot name (4bbe355), closes #3562
  • mongo: do not expand array queries to $in operator when nested inside $eq (e25d28e)
  • postgres: add qb.distinctOn() support (307d3a1)
  • query-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 (#3529) (d035781)
  • sqlite: enable returning statements in both SQLite drivers (eaf83c8)

Performance Improvements

  • core: don't propagate serialization context to hidden relations (#3592) (e706ba2)
  • core: improve support for large collections (#3573) (ea3f6fd)
  • schema: improve schema inspection speed in SQL drivers (#3549) (74dc3b1)

Type-level breaking changes

  • It is no longer possible to do collection.add(...items) with a generic array - it only works with a tuple. The solution is to do collection.add(items) instead, which will type check and is also more performant (no array copies). (#3573)

v5.4.2

12 Sep 21:06

Choose a tag to compare

5.4.2 (2022-09-12)

Bug Fixes

  • core: do not double serialize nested JSON properties in embedded arrays (11112c6), closes #3327
  • core: fix dynamic loading of entities with default export (14f88cc), closes #3491
  • core: fix extracting entity reference for constructor params in em.create() (797cc3a)
  • core: fix populating of self referencing relationships (e3c835a), closes #3490
  • core: fix serialization of virtual entities (a15fc13), closes #3493
  • core: ignore * populate hints inferred from fields (c11bda6)
  • core: omit internal symbols from logged entities (29c430c)
  • core: respect serialization flags on embedded properties (8e9f6d9), closes #3429

Features

  • cli: add mikro-orm-esm CLI script with registered ts-node/esm loader (443f0c8), closes #3485
  • entity-generator: generate OptionalProps symbols (#3482) (6ba3d40)
  • knex: allow changing FROM clause using QueryBuilder (#3378) (df7d939)

v5.4.1

08 Sep 21:36

Choose a tag to compare

5.4.1 (2022-09-08)

Bug Fixes

  • cli: only use dynamic imports for ESM projects (b3e43d0), closes #3442
  • core: add missing MIKRO_ORM_SCHEMA env var (#3464) (47fccac)
  • core: allow symbol as propertyKey in @UseRequestContext decorator (#3444) (6a60295)
  • core: change internal dependencies to use ~ instead of ^ (fdbf67c), closes #3468
  • core: support partial loading of inlined embeddables (9654e6e), closes #3365
  • migrations: replace backslash in the glob to fix windows support (9e2b549), closes #2243
  • postgres: fix inserting values with ? into FullTextType properties (5095ddb), closes #3457
  • postgres: fix parsing enum definition when one of the items has comma (c8062cb), closes #3460
  • reflection: fix inference of nullability (5f57ee1), closes #3447

Features

  • core: allow custom ORM prop name in @UseRequestContext() (#3475) (d87219e)

v5.4.0

01 Sep 09:05

Choose a tag to compare

5.4.0 (2022-09-01)

Bug Fixes

  • cli: allow working with mongo migrations via CLI (14a07df)
  • core: allow embedded properties inside virtual entities (541d62d)
  • core: allow using $ne operator on embedded properties (89706b6), closes #3430
  • core: always use dynamic import, don't depend on MIKRO_ORM_DYNAMIC_IMPORTS (ba7eac6)
  • core: compile with module: 'Node16' to have real dynamic imports (#3439) (50347ef)
  • core: fix optimistic locking for entities with custom type on PK (e36bac5), closes #3440
  • core: lock entities in flush() to get around race conditions with Promise.all (b62799a), closes #2934 #3383
  • core: respect serialization options like hidden on embeddables (d198e44), closes #3429
  • core: support result caching on virtual entities (ce2b051)
  • core: update to TypeScript 4.8 and improve EntityDTO type (#3389) (f2957fb)
  • core: use acorn instead of escaya for extraction of method params (c5c09c5)
  • knex: support em.count() on virtual entities (5bb4ebe)
  • postgres: fix escaping of special chars in string arrays (#3405) (cd7c42f)
  • query-builder: allow using alias for delete queries (aa19a85), closes #3366
  • query-builder: support more operators in join conditions (#3399) (af885c8)
  • reflection: do not override user defined nullable attribute (75a6487)
  • reflection: fix array property type inference (4a69871)

Features

  • core: add MikroORM.reconnect() method (53b836e)
  • core: add schema/migrator/seeder shortcuts to MikroORM class (95c8dd5)
  • entity-generator: add import extension for referenced entities (#3420) (f80809a)
  • knex: add options params to create + assign methods within EntityRepository (#3431) (cf7e9e1)

v5.3.1

04 Aug 23:31

Choose a tag to compare

5.3.1 (2022-08-04)

Bug Fixes

  • core: copy orphan removal stack to forks when clear: false (ab72144), closes #3360
  • core: improve check for global context usage (6c906bf), closes #3361
  • core: improve cycle detection when serializing (mainly via toPOJO) (aa10802), closes #3354
  • core: respect contextName in TransactionContext (b2b6a7d), closes #3362

v5.3.0

01 Aug 08:46

Choose a tag to compare

5.3.0 (2022-08-01)

Bug Fixes

  • core: do not trigger auto flush from inside flush hooks (e3f34aa), closes #3345
  • entity-generator: ensure stable order of generated entities (06e0e05)
  • postgres: fix having non-PK serial column next to a non-serial PK (6c589b0), closes #3350
  • query-builder: fix qb.insert()/update() on embeddables in inline mode (#3340) (e611fa0)
  • schema: ensure stable order queries (e56a259), closes #3330
  • schema: respect explicit columnType when comparing columns (f0a20fa), closes #3317
  • schema: respect schema when renaming columns in postgres (#3344) (f905336)
  • sqlite: throw ForeignKeyConstraintViolationException where appropriate (#3343) (508e262)

Features

  • add support for full text searches (#3317) (8b8f140)
  • core: add $exists mongodb operator with SQL fallback to is not null (112f2be), closes #3295
  • core: add disableContextResolution option to em.fork() (94442f9), closes #3338
  • core: add support for virtual entities (#3351) (dcd62ac)
  • core: add validation when using non-discovered entities in em.populate() (ab93106)
  • core: improve autocomplete for columnType (6bf616d)
  • core: improve autocomplete for type, onUpdateIntegrity and onDelete (7ee2dcb)
  • entity-generator: allow defining entities with EntitySchema instead of decorators (b423c10)
  • mongo: add support for migrations in mongo driver (#3347) (c5c6115)
  • mongo: allow reusing mongo client via driverOptions (df59ebf), closes #3352

v5.2.4

25 Jul 21:51

Choose a tag to compare

5.2.4 (2022-07-25)

Bug Fixes

  • core: do not allow passing null to required properties in em.create() (e7843fb), closes #3289
  • core: do not run onUpdate before we know something changed (6faa367), closes #3328
  • core: ensure m:n collection is not dirty after hydration (66e0a21), closes #3323 #3287
  • core: hidden properties are included in cache (#3300) (f0bc261)
  • core: respect schema when lazy loading reference via init (c876c9f), closes #3318
  • knex: fix $or over 1:m and m:1 auto-joined relations (#3307) (b6f12b2)

Features

  • knex: allow partial loading of 1:1 owner property from inverse side (d642018), closes #3324

v5.2.3

08 Jul 07:43

Choose a tag to compare

5.2.3 (2022-07-08)

Bug Fixes

  • core: ensure M:N collections are not dirty after populating of inverse side (21ba9b2), closes #3287
  • mariadb: backport some fixes from the mysql driver (9a57386)
  • mariadb: fix inference of nullable columns when generating entities (4bd606a), closes #3285
  • mongo: fix ensuring indexes on failure (#3276) (da20e1f)

v5.2.2

03 Jul 17:12

Choose a tag to compare

5.2.2 (2022-07-03)

Bug Fixes

  • core: consider two NaN as equal when computing changesets (#3250) (95116a0)
  • core: ensure correct context usage in all EntityManager public methods (cc6d59b), closes #3271
  • core: ensure FK as PK is not marked as initialized too early (f12f92f), closes #3269
  • core: fix populating of 1:m collections between wildcard schema entities (69c06aa), closes #3270
  • core: fix populating of relations in afterFlush hook (26ab686), closes #3005
  • core: fix querying JSON properties with operators directly (077ca62), closes #3246
  • mongo: persist explicit null value on object embeddable as null (1c56e7a), closes #3258
  • mongo: retry only 3 times if ensuring indexes fails (#3272) (299a028)
  • seeder: fs-extra dep (#3268) (972e5ba)
  • sql: fix prefixing of JSON queries nested on relations (847ff46), closes #3242

Features

  • core: propagate add operation to m:n owner even if not initialized (#3273) (dc9255c)

v5.2.1

21 Jun 23:11

Choose a tag to compare

5.2.1 (2022-06-21)

Bug Fixes

  • core: fix reloading version values with custom types on PKs (ebd7888), closes #3209
  • core: fix serialization of entities wrapped in POJOs (af4fadf), closes #3221
  • core: ignore undefined values during options merge (9e0f559), closes #3234
  • core: prefer current schema for loading wild card pivot table entities (f40cafa), closes #3177
  • mongo: recreate indexes when they differ (60fc7f6), closes #3118
  • mongo: use $unset when property value is undefined (f059811), closes #3233
  • mysql: handle mediumint PKs correctly (0bbbe5c), closes #3230
  • types: fix inference of optional PKs (424e0bb), closes #3230

Features

  • core: allow to adjust default type mapping (ca8ce57), closes #3066

Performance Improvements

  • core: allow disabling change tracking on property level (7d5e32d), closes #3019
  • core: make Collection.add on not managed entities much faster (75adda9), closes #3211