Releases: mikro-orm/mikro-orm
Releases · mikro-orm/mikro-orm
v5.5.0
5.5.0 (2022-10-23)
Bug Fixes
- cli: fix using
npx --workspacewithmikro-orm-esm(#3560) (64777af) - cli: improve success message of
schema:update/dropcommands (11d0fd9) - core: always compare boolean properties as booleans (c30c680), closes #3576
- core: do not ignore
defaultoption 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
mapToPkproperties 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
$notoperator in join condition (#3609) (047504f)
Features
- core: add
defineConfighelper (#3500) (67d3c68) - core: add
em.refresh(entity)method (#3522) (dbe8aa4) - core: add
em.upsert()method (#3525) (3285cdb), closes #3515 - core: add
MikroORMandOptionsexports to each driver package (#3499) (b68ed47) - core: add the
offsetintoFindOneOptions(#3574) (9d5d457) - core: automatically detect
src/dist/buildfolders and adjust configuration (#3497) (a8c8baf) - core: enable
persistOnCreateby default (8424976) - core: maintain identity for the
Referencewrapper (da1a0ef), closes #3582 - core: provide
metaandpropon 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
EntitySchemadefinition (0716566), closes #3603 - migrations: allow configuring snapshot name (4bbe355), closes #3562
- mongo: do not expand array queries to
$inoperator 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 docollection.add(items)instead, which will type check and is also more performant (no array copies). (#3573)
v5.4.2
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 fromfields(c11bda6) - core: omit internal symbols from logged entities (29c430c)
- core: respect serialization flags on embedded properties (8e9f6d9), closes #3429
Features
v5.4.1
5.4.1 (2022-09-08)
Bug Fixes
- cli: only use dynamic imports for ESM projects (b3e43d0), closes #3442
- core: add missing
MIKRO_ORM_SCHEMAenv var (#3464) (47fccac) - core: allow symbol as propertyKey in
@UseRequestContextdecorator (#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
globto fix windows support (9e2b549), closes #2243 - postgres: fix inserting values with
?intoFullTextTypeproperties (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
v5.4.0
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
$neoperator 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 withPromise.all(b62799a), closes #2934 #3383 - core: respect serialization options like
hiddenon embeddables (d198e44), closes #3429 - core: support result caching on virtual entities (ce2b051)
- core: update to TypeScript 4.8 and improve
EntityDTOtype (#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
nullableattribute (75a6487) - reflection: fix array property type inference (4a69871)
Features
v5.3.1
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
contextNameinTransactionContext(b2b6a7d), closes #3362
v5.3.0
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
columnTypewhen comparing columns (f0a20fa), closes #3317 - schema: respect schema when renaming columns in postgres (#3344) (f905336)
- sqlite: throw
ForeignKeyConstraintViolationExceptionwhere appropriate (#3343) (508e262)
Features
- add support for full text searches (#3317) (8b8f140)
- core: add
$existsmongodb operator with SQL fallback tois not null(112f2be), closes #3295 - core: add
disableContextResolutionoption toem.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,onUpdateIntegrityandonDelete(7ee2dcb) - entity-generator: allow defining entities with
EntitySchemainstead 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
5.2.4 (2022-07-25)
Bug Fixes
- core: do not allow passing
nullto required properties inem.create()(e7843fb), closes #3289 - core: do not run
onUpdatebefore 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
v5.2.3
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
5.2.2 (2022-07-03)
Bug Fixes
- core: consider two
NaNas equal when computing changesets (#3250) (95116a0) - core: ensure correct context usage in all
EntityManagerpublic 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
afterFlushhook (26ab686), closes #3005 - core: fix querying JSON properties with operators directly (077ca62), closes #3246
- mongo: persist explicit
nullvalue on object embeddable asnull(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
v5.2.1
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
undefinedvalues 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
$unsetwhen property value isundefined(f059811), closes #3233 - mysql: handle mediumint PKs correctly (0bbbe5c), closes #3230
- types: fix inference of optional PKs (424e0bb), closes #3230