Changelog
Release notes are sourced from GitHub Releases across the entire monorepo.v7
7.0.12 (2026-04-23)
Bug Fixes
- core: avoid crash on STI subclass @ManyToOne override targeting same hierarchy (#7599) (eeebf6f), closes #7598
- core: expand polymorphic entity refs in where filters (#7579) (32a0f08), closes #7578
- core: expand polymorphic entity refs inside scalar operators (#7581) (1027e90), closes #7579 #7578
- core: recognize TypeScript's
__esDecorate helper in decorator path lookup (#7584) (ad9c86a), closes #7583
- core: skip getter-only properties in assignDefaultValues (#7575) (0251777), closes #7574
- mysql: resolve password callback per-connection for short-lived tokens (#7577) (9b9fe2d), closes #7576
- postgres: schema-qualify generated
drop index statements (#7603) (c32bbd6)
- sql: forward ignoreBranch options for M2M pivot alias resolution (#7591) (0cb4895), closes #7590
7.0.11 (2026-04-16)
Bug Fixes
- core: allow
unknown values for Opt<unknown> properties (#7555) (7368fa1)
- core: hydrate version property when merging data via SELECT_IN populate (#7547) (23ed086), closes #7543
- core: prevent infinite loop with
populate: ['*'] and refresh: true (#7548) (2f0518f), closes #7544
- core: support TPT inheritance targets in polymorphic relations (#7564) (0e818fa), closes #7563
- core: unwrap IType serialized type for scalar-based properties in EntityDTO (#7549) (42e4675)
- core: validate TPT leaf entity indexes against own properties (#7573) (1f5e518), closes #7570
- decorators: allow ES decorators on abstract classes (#7556) (a4eb8f2), closes #7553
- migrations: skip database connection in
create() and getPending() when snapshot exists (#7568) (4bf6ed5), closes #7493
- postgres: normalize
!= to <> in check constraint diffing (#7541) (b8ad2b0), closes #7540
- schema: convert default values of custom-typed properties to DB form (#7567) (0c1d2c9), closes #7565
- schema: detect native enum value changes on array columns (#7561) (ec20701), closes #7560
Features
- core: add
logging option to em.upsert(), nativeUpdate() etc (#7562) (8808779), closes #7557
7.0.10 (2026-04-10)
Bug Fixes
- core: avoid forwarding
cwd: undefined to tinyglobby (#7510) (6a134f4), closes #7509
- core: brand raw query fragments via prototype property (#7519) (f596bdd), closes #7518
- core: emit enum check constraints for embedded enum properties (#7526) (6f52ad1)
- core: guard user-defined prototype getters against deep-clone walkers (#7508) (83254db), closes #7151
- core: populate TPT child-specific relations when entity is already in identity map (#7536) (8fa3ac2), closes #7529
- core: skip composite PK inlining when operator value is an array (#7524) (b0ccf51)
- core: skip inverse collections when deduplicating ownColumns (#7504) (40b2760), closes #7490
- core: skip namespace-merged functions in
extractEnumValues (a08e685), closes #7500
- core: skip overwriting loaded entities with uninitialized references during transaction merge (#7531) (25214f2), closes #7528
- core: use change set meta in commit order to fix cross-ORM flush (#7513) (02303e8), closes #7511
- core: use globally registered entity marker symbol (#7518) (294ed5f), closes #7515
- core: use globally registered symbols for Reference/Collection markers (#7535) (47e5d9f), closes #7515 #7515 #7534
- sql: allow joining relations on entity-typed CTE in
from() (#7523) (514fb4e), closes mikro-orm/mikro-orm#7485
- sql: skip redundant mapResult in QB when row is already mapped (#7533) (1e654a9), closes #7527
7.0.9 (2026-04-06)
Bug Fixes
- core: escape special characters in base Platform array marshalling (#7489) (9bc798f), closes #7488
- core: include generated columns in mergeData diff for identity map reuse (#7491) (97fd5c6), closes #7421 #7486
- core: resolve EntityIdentifier in composite FK with shared join columns (#7477) (cb44ba0)
- core: respect compiledFunctions in driver's EntityComparator (#7494) (d2c5cce)
- core: skip shared join columns with null value in mapDataToFieldNames (#7490) (f6b4273)
- core: use symbol brand in CollectionShape to prevent false structural matches (#7473) (c9e93e4), closes #7470
- migrations: skip database connection in checkSchema() when snapshot exists (#7493) (2bcde16)
- sql: fix null composite FK producing
undefined column values in nativeInsertMany (#7476) (7043886), closes #7475
- sql: fix populate of 1:1 on TPT leaf entity with joined strategy (#7474) (053881c), closes #7469
- sql: skip relation props without fieldNames in TPT column mapping (#7472) (b63d6ba), closes #7471
- sql: use composite unique constraint for OneToOne on STI entities (#7480) (cef70b9), closes #7479
7.0.8 (2026-04-01)
Bug Fixes
- core: exclude namespace functions from enum type inference in
defineEntity (#7449) (3ed8060), closes #7446
- core: fix wrong column name for nested inline embeddables when parent is null (#7464) (b784da9), closes #7463
- core: make recomputeSingleChangeSet TPT-aware (#7460) (618695d), closes #7455
- core: populate child-specific relations for TPT entities with
populate: ['*'] (#7459) (8962ef9), closes #7453
- core: resolve circular type inference in
defineEntity with composite primaryKeys (#7447) (b5e6442), closes #7445
- core: skip FK nullification on orphan removal when FK is part of PK (#7462) (134eca7), closes #7461
- core: use full entity snapshot for TPT entities in commitCreateChangeSets (#7458) (0a0a1c0), closes #7454
- sql: use pivot entity schema for wildcard check in M:N joins (#7466) (cd0d47d)
7.0.7 (2026-03-31)
Bug Fixes
- core: apply embedded sub-property defaults during upsert (#7411) (baf89e1)
- core: fire orphan removal for OneToOne replacement when inverse already set (#7436) (6e4fe2a)
- core: preserve user changes on references during initialization (#7421) (69ed5be)
- core: prevent incorrect nullification of 1:1 inverse relations during joined loading (#7434) (725e924)
- core: resolve circular type inference in defineEntity with repository + filters (#7441) (0ad9c60), closes #7440
- core: resolve entity name from registry in MetadataProvider (#7408) (6953f34)
- core: skip required validation for embeddables with only formula properties (#7429) (88eb092)
- core: use className instead of tableName for pivot join column names (#7430) (5767c20)
- mssql: use equality conditions for composite PK batch updates (#7442) (ba4063b)
- sql: fix count queries with composite PKs and toMany joins (#7415) (bb0d66c), closes #7414
- sql: fix nativeEnumName schema handling with config-level schema (#7435) (2ddd288), closes #7432
- sql: generate indexes for materialized view entities (#7419) (bf86941), closes #7417
- sql: infer Kysely table names for classes extending
defineEntity().class (#7425) (469a667), closes #7423
- sql: pass transaction context through schema introspection to avoid deadlock (#7426) (2a1bc05), closes #7424
- sql: resolve alias placeholder in raw fragments used as operator values (#7427) (d23d30b), closes #7422
7.0.6 (2026-03-26)
Bug Fixes
- core: allow
readonly enum builder items in defineEntity() (#7406) (ebf87e6), closes #7352
- core: apply onCreate hooks in em.upsert and em.upsertMany (#7400) (5bc0e92), closes #7399
- core: preserve explicit entity name in defineEntity + setClass during discovery (fca6e6b), closes #7391
- core: prevent prototype pollution in
Utils.merge (954bdba)
- core: tighten query construction validation (f7e59a5)
- decorators: handle esbuild ES decorator stack frames in path lookup (e6ea9fc)
- reflection: resolve inherited property types with ES decorators in TsMorphMetadataProvider (8296a0e), closes #7389
- schema: escape single quotes in enum CHECK constraints (#7396) (3656519), closes #7395
7.0.5 (2026-03-23)
Bug Fixes
- core: handle
check constraint in defineEntity (#7374) (a46ae8a)
- core: handle Bun path lookup for native ES decorators (#7382) (9916203), closes #7381
- core: handle JSON column type conversion in
em.refresh() for detached entities (6c4e896), closes #7383
- core: ignore discriminator column in changeset for uninitialized STI references (#7385) (a7db194), closes #7384
- core: share EntitySchema.REGISTRY across CJS/ESM module boundaries (#7377) (7c1e5d4), closes #7376
- mssql: force-disconnect sessions before dropping database (bdc45e4)
- sql: infer FK columns for decorator entities in
getKysely types (#7368) (81068f3), closes #7367
- sql: use column name mapping for decorator entities in
getKysely types (#7369) (d3baa56), closes #7367
7.0.4 (2026-03-20)
Bug Fixes
- core: accept readonly arrays in
EnumOptions.items (c287a1f), closes #7352
- core: discover
defineEntity classes via glob when only class is exported (#7355) (fccc42e)
- core: exclude unloaded lazy ref properties from snapshot generator (#7353) (48ea304)
- core: prevent double-wrapping of ScalarReference in hydrator (ac1f66e)
- core: strip
persist: false properties from upsert data (#7345) (4b5a833), closes #7344
- decorators: handle Rolldown-bundled @oxc-project/runtime in path lookup (14d04ae)
- migrations: stop making up() and down() async unnecessarily (#7338) (3612f79)
- reflection: detect array enums from text-based type before clearing enum flag (02d2b52), closes #7352
- sql: accept custom types in QueryBuilder operators for joined entities (#7342) (0aaafbf), closes #7341
- sql: prune redundant joins in pagination outer query (#7339) (48acce9), closes #6681
Features
- cli: add oxc as a TS loader option via
@oxc-node/core (#7354) (3d62317)
- postgresql: generate check constraints for enum array columns (#7356) (ec10597), closes #7352
7.0.3 (2026-03-18)
Bug Fixes
- cli: support Yarn PnP with ESM loader (#7327) (af227cb), closes #7324
- core: add missing index/unique options to defineEntity type (#7320) (289b81d)
- core: allow base entity properties in defineEntity indexes/uniques with extends (#7326) (364f7ae)
- core: provide intellisense for
fields hint in find options (#7325) (4383d9b)
- core: respect partial loading fields hint in serialize() return type (#7333) (b8628c7)
- decorators: polyfill metadata symbol if not available (#7312) (af64dca)
- postgres: handle native enum arrays in non-default schemas (#7330) (71a1014), closes #7318
- schema: handle SELECT * expansion in view schema diffing (#7313) (3a05128), closes #7308
- sql: convert undefined FK values to null in batch updates (#7334) (b2240eb)
- sql: fix polymorphic relations with default filters on target entities (#7332) (40777d2), closes #7317
- sql: fix populating TPT relations with embeddables or custom types in child entities (#7331) (5fc6311), closes #7329
Features
7.0.2 (2026-03-14)
Bug Fixes
- core: apply property
default values when creating new entity instances (#7301) (b4d1e7f), closes #7284
- core: handle CJS entity files in folder-based discovery (#7287) (314626b)
- core: preserve nullability in Opt/Hidden branded types for defineEntity (#7295) (2b74802), closes #7291
- core: use branded types for built-in type detection in CJS/ESM dual-package hazard (#7293) (65ae903)
- core: use EntitySchema.is() instead of instanceof for CJS/ESM dual-package hazard (#7289) (355301f)
- decorators: skip @oxc-project/runtime frames in decorator path lookup (199ccd1)
- entity-generator: emit enum definitions before entity class (bbb38c7)
- schema: handle multiline view expressions in SQLite schema diffing (#7294) (2a2ed10), closes #7292
7.0.1 (2026-03-11)
Bug Fixes
- update lockfile for v7 peer dependencies (d59eaea)
- update peer dependency constraints to v7 and pin on release (fbeace5)
7.0.0 (2026-03-11)
Release blogpost: https://mikro-orm.io/blog/mikro-orm-7-released
Upgrading guide: https://mikro-orm.io/docs/upgrading-v6-to-v7
Features
- add JSR publishing support (#7253) (c93c92a)
- change default
loadStrategy to balanced (431f989)
- cli: support various TS loaders (#6987) (3fe125c)
- core: add
$size collection operator (#7090) (e12051e)
- core: add
collation support and MongoDB query options (#7189) (e350aa1)
- core: add
EntityName symbol for decorator-based Kysely type inference (#7199) (0b78e36)
- core: add
EntitySchema.new helper to create entity instances (#7077) (64ad492)
- core: add
forceObject option to defineEntity (0a3df4d)
- core: add
populateHints option to FindOptions for per-relation populate overrides (#7198) (158e1cf)
- core: add entity-level default
orderBy option (#7133) (4bfa0e4)
- core: add slow query logging support (#7271) (13b97f5), closes #4695
- core: add support for polymorphic relations (#7121) (e9eb256)
- core: add support for streaming (#6923) (88b0d5b)
- core: add support for Table-Per-Type inheritance (#7137) (f6abee5)
- core: add support for view entities (#7116) (7bfcb10)
- core: add WHERE clause support to upsert via
onConflictWhere option (#7117) (673c1bb)
- core: allow reusing raw query fragments (#7058) (bcf8cb7)
- core: execute transaction events on child transactions (0fc822f)
- core: improve formula callback to provide more information about the table and column mapping (#7105) (9ee78d5)
- core: improve type safety of various decorators (463eef6)
- core: make
em.assign typing stricter to catch typos (5c3aea1)
- core: make
em.create typing stricter to catch typos (39e8c30)
- core: move file discovery to separate file (#6993) (d880412)
- core: propagate persist stack in
em.transactional fork (0c90e67)
- core: support FKs pointing to non-PK columns via
targetKey option (#7099) (f98541b)
- core: support null values in cursor-based pagination (#7095) (b1fb67c)
- core: support pre-compiled functions for eval-free runtimes (#7166) (d8b2c3e)
- core: validate dangerous property names (#7089) (78e570d)
- decorators: introduce
@mikro-orm/decorators package with legacy and ES decorator definitions (#7011) (81e5e97)
- defineEntity: allow extending generated class with custom methods (#7104) (25362b8)
- entity-generator: add
manyToManyPropertyName to NamingStrategy (#7130) (edf1c49)
- kysely: add
MikroKyselyPlugin to support various ORM features with kysely (#6998) (d01d93b)
- migrations: remove umzug dependency, improve bundler support (#7203) (05f195f)
- oracle: add Oracle DB driver (#6704) (ef140af)
- postgres: add support for materialized views (#7119) (b68e774)
- query-builder: add support for common table expressions (CTE) (#7231) (ebd0d43)
- schema: add native support for advanced index features (#7160) (a2330d2)
- schema: allow changing defaults for
update/deleteRule and remove inference from cascade option (#7115) (dd6a226)
- schema: allow skipping views (#7150) (be74bf9)
- seeder: remove
tinyglobby dependency, add seedersList option (#7206) (7f923e5)
- sql: add
$elemMatch operator for JSON array properties (#7265) (e40a275)
- sql: improve
QueryBuilder type safety with context-aware types (#7138) (631e351)
- sql: infer Database for kysely (#6939) (8f8ada5)
- sql: replace knex with kysely (#6400) (2a0384e)
- sql: replace knex with native implementation of query and schema building (#6358) (c8471ca)
- sql: strictly type
SelectQueryBuilder.execute() return type (#7200) (1e15042)
- sql: support aliasing formula and regular properties in
QueryBuilder select (#7190) (6d8da38)
- sql: support UNION-based where clauses as index-friendly alternative to
$or (#7214) (1e8a674)
- sql: transparent querying of embedded array properties (#7264) (c9f13bb), closes #1887
- sqlite: add
ATTACH DATABASE support for multiple database files (#7131) (27f9cac)
- sqlite: enable down migrations (bd3bb56)
- sqlite: simplify using other sqlite libraries like
node:sqlite (#7204) (7e8da43)
Bug Fixes
- core: allow using property accessor on to-one relations (621d10a), closes #7211
- core: always check the database when querying by PK with filters (8bd62b2), closes #7084
- core: do not convert custom types in
em.refresh (3f8abdf), closes #7073
- core: do not propagate cursor related options to populate queries (e667290), closes #7148
- core: duplicate discovery of embeddables with defineEntity (#7125) (3d57516)
- core: enable
forceUtcTimezone by default for all SQL drivers (#7087) (c89890b), closes #5591
- core: ensure
populate hint won't include undefined for optional relations (ea6722c)
- core: ensure column name conflicts in M:N are propagated to STI child entities (562515c), closes #7123
- core: ensure no collisions in polymorphic embeddables with shadowed properties (25554b1)
- core: ensure owning FK is selected for to-many inverse sides (cead90d)
- core: fix applying filters on nested relation conditions (e828240)
- core: fix double processing of JSON properties when reloading an entity (945e5cd)
- core: fix enum arrays with
defineEntity failing on metadata validation (0412fd3)
- core: fix findOne with entity refs for composite PKs with shared FK columns (b8a39e2), closes #5629
- core: fix processing filters on to-many relations (8b193aa)
- core: fix result caching for custom types (10a4044), closes #7112
- core: improve handling of deeply nested composite keys in
em.create (28261a0), closes #6894
- core: improve intellisense for partial loading in
em.populate (384f432)
- core: make entity prototype
toJSON non-enumerable to prevent data leaks (013f57f)
- core: map arrays inside object embeddables to JSON arrays by default (6835f72)
- core: normalize
populate option in Collection.matching() for M:N relations (#7091) (d9b996f)
- core: only respect
Hidden type on scalar properties (#7097) (36372a2), closes #7062
- core: preserve embeddable properties in
toPOJO regardless of partial loading hints (455be24)
- core: preserve function expression indexes through metadata cache round-trip (#7228) (b7c002c)
- core: prevent double JSON-encoding of nested embeddable arrays (ba22eba)
- core: prevent property mutation during polymorphic embeddable discovery (#7270) (c3a5978), closes #6522
- core: respect
exclude hint in implicit serialization via toObject (#7259) (cd9e09f)
- core: respect
exclude option on eager properties (908e236)
- core: respect
orphanRemoval on 1:1 relations when inverse side is a PK (#7081) (960425c)
- core: respect custom repositories with
InferEntity (c5160ee)
- core: respect EM schema when joining a wildcard entity from a static schema entity (69ca26c), closes #7082
- core: respect explicit
tableName when computing join table names (fe5e10f)
- core: respect loaded hint for
Ref relations inside array embeddables (27efe05)
- core: support overlapping properties with different field names in STI (5d83d0f), closes #5813
- core: support querying by all keys of discriminated union types (21b7a80), closes #7111
- core: support schema parameter in formula query when using QB with partial loading (4820bb6)
- core: support wildcard
wrap(e).populate() hints on type level (a05e46c)
- core: use full hydration in
mergeData for initialized entities (32a0baa), closes #7205
- core: use less strict
repository option type to fix issues with defineEntity and cycles (7110dc3)
- defineEntity: fix inference issues in
hooks definition (d5e9f92)
- entity-generator: strip schema prefix from FK property names (#7134) (173ff9b)
- guard prototype.toJSON against being called on prototype itself (#7152) (0392156), closes #7151
- migrations: delete snapshot file after
migration:down (95e0d88)
- migrations: normalize snapshots and write on both up/down (#7235) (511d8ad)
- migrations: skip snapshot write on
migration:up to support read-only filesystems (c5ebd0a)
- migrations: support emitting multiline comments (#7186) (2fe61c8)
- mongo: fix field name conversion when querying object embedded entities (a713819)
- mongo: fix support for deno by handling
TypedArray when cloning (#7258) (17ec4f5)
- mongo: rework support for serialized primary keys (54ad3c5)
- postgres: fix phantom diffs for complex check constraints (#7216) (b0fefd0)
- postres: fix casting of object embedded relation properties (0e80f59)
- query-builder: apply
WHERE conditions to ORDER BY joins in paginated queries (128e58b), closes #6160
- schema: disable FK checks by default only for
orm.schema.clear() in MySQL (c0d942d)
- schema: do not ignore changes to entity level comments (4087704), closes #7187
- schema: do not infer nullability of to-one relations based on
cascade option (56be7f3), closes #6972
- sql: always alias virtual properties in where query (37f35af), closes #7196
- sql: cross-schema JOINs no longer inherit main entity's schema (#7250) (07852fc)
- sql: fix populating M:N relations with
pivotEntity that uses mapToPk: true (cdd8f85), closes #7107
- sql: handle $not operator inside relation filters (#7226) (b002e16)
- sql: ignore missing tables during schema clear (8f90f07)
- sql: qualify cross-schema FK references with
dbName on MySQL/MariaDB (#7251) (489d2b9)
- sql: skip pagination subquery and force balanced strategy for virtual entities (e2c1287), closes #7195
- sti: ensure stable order in the generated discriminator map (b51d6fd), closes #6455
Performance Improvements
- core: improve
defineEntity type performance (#7202) (d7491a7)
- core: improve
InferEntity performance when extends is used (#7120) (f6640e8)
- core: improve
Loaded type performance by optimizing field selection (#7201) (a34269a)
- core: improve inference via
InferEntity type (#7108) (9f8f393)
- core: optimize
AutoPath and Loaded type instantiation costs (#7128) (6f7349d)
- core: optimize
em.assign typing (#7129) (9e84be3)
- core: optimize type instantiation costs with structural shapes (#7132) (b6b0f0f)
- core: rework auto-flush detection to rely on explicit
em.persist calls (#6982) (e66f138)
v6
6.6.13 (2026-04-10)
Bug Fixes
- core: guard prototype-installed methods and accessors against
this === prototype (#7512) (62928f1), closes #7508 #7151 #7151
- core: resolve EntityIdentifier in composite FK with shared join columns (#7478) (dcf89d7), closes #7477
- core: skip composite PK inlining when operator value is an array (#7525) (030d82b), closes #7524
- core: skip inverse collections when deduplicating ownColumns (#7505) (132a8d2), closes #7504 #7492
- core: skip overwriting loaded entities with uninitialized references during transaction merge (#7532) (7ab9769), closes #7531 #7528
- core: skip shared join columns with null value in mapDataToFieldNames (#7492) (eaa2712), closes #7490
6.6.12 (2026-04-01)
Bug Fixes
- core: recursively nullify nested inline embeddable columns when parent is null (#7465) (a711523), closes #6966 #7463
- core: skip FK nullification on orphan removal when FK is part of PK (#7461) (7cc10c0), closes #7439 #7436
- knex: use pivot entity schema for wildcard check in M:N joins (#7467) (795d62b), closes #7466
- migrations: save transaction ref before prefix() deletes it from options (#7443) (586f5b9), closes #7424
6.6.11 (2026-03-31)
Bug Fixes
- core: fire orphan removal for OneToOne replacement when inverse already set (#7439) (674efd0), closes #7436
- core: prevent incorrect nullification of 1:1 inverse relations during joined loading (#7434) (1d46f0f)
- knex: allow contextual type inference for
raw() with string inputs (1683a54)
- sql: pass transaction context through schema introspection to avoid deadlock (#7431) (03bd640), closes #7426 #7424
6.6.10 (2026-03-26)
Bug Fixes
- core: handle JSON column type conversion in
em.refresh() for detached entities (e41b500), closes #7383
- core: prevent prototype pollution in
Utils.merge (06ed5f6)
- core: tighten query construction validation (ad3643e)
- schema: escape single quotes in enum CHECK constraints (#7397) (db19731), closes #7396 #7395
6.6.9 (2026-03-05)
Bug Fixes
- core: fix findOne with entity refs for composite PKs with shared FK columns (6f95f72), closes #5629
- core: make entity prototype
toJSON non-enumerable to prevent data leaks (c895808)
- core: prevent double JSON-encoding of nested embeddable arrays (309b278), closes #7233
- migrations: normalize snapshots and write on both up/down (#7236) (a07aca6), closes #7234
- migrations: skip snapshot write on
migration:up to support read-only filesystems (c8584e8), closes #7232
- mysql: fix
table.bigincrements() producing int instead of bigint (5660607), closes #7246
6.6.8 (2026-03-01)
Bug Fixes
- core: allow using property accessor on to-one relations (06978c9), closes #7211
- core: fix double processing of JSON properties when reloading an entity (514ed87)
- core: preserve embeddable properties in
toPOJO regardless of partial loading hints (c27dbae)
- core: preserve function expression indexes through metadata cache round-trip (#7229) (9ae8d20), closes #7238
- core: use full hydration in
mergeData for initialized entities (5529308), closes #7205
- knex: handle $not operator inside relation filters (#7227) (d0dac2f), closes #7226
- migrations: delete snapshot file after
migration:down (dfcc8c6), closes #7210
- postgres: fix phantom diffs for check constraints (#7224) (103346c)
6.6.7 (2026-02-15)
Bug Fixes
- core: do not propagate cursor related options to populate queries (e6b9a6a), closes #7148
- core: ignore empty conditions produced by filters (1ebbfb0)
- guard prototype.toJSON against being called on prototype itself (#7152) (fa5290e), closes #7151
- migrations: support emitting multiline queries (fcf360a), closes #7185
- schema: do not ignore changes to entity level comments (b421c9d), closes #7187
- sql: always alias virtual properties in where query (2f7492d), closes #7196
- sql: skip pagination subquery and force balanced strategy for virtual entities (260a2e0), closes #7195
Features
- core: add WHERE clause support to upsert via
onConflictWhere option (#7181) (9ed5ef5)
6.6.6 (2026-01-30)
Bug Fixes
- core: ensure column name conflicts in M:N are propagated to STI child entities (5be76ae), closes #7123
- core: ensure no collisions in polymorphic embeddables with shadowed properties (b7707b4)
- core: fix result caching for custom types (b0ed700), closes #7112
- core: respect
exclude option on eager properties (cb26a7e)
- core: support schema parameter in formula query when using QB with partial loading (30b37f7), closes #7102
- core: use less strict
repository option type to fix issues with defineEntity and cycles (aeb1bb1)
6.6.5 (2026-01-21)
Bug Fixes
- core: always check the database when querying by PK with filters (bd44c82), closes #7084
- core: ensure
populate hint won't include undefined for optional relations (fede490)
- core: improve handling of deeply nested composite keys in
em.create (8caae8f), closes #6894
- core: normalize
populate option in Collection.matching() for M:N relations (#7091) (886772a)
- core: support overlapping properties with different field names in STI (badbc00), closes #5813
- sql: fix populating M:N relations with
pivotEntity that uses mapToPk: true (0ab55fe), closes #7107
Features
- core: improve formula callback to provide more information about the table and column mapping (#7105) (059bf97), closes #7102
6.6.4 (2026-01-14)
Bug Fixes
- core: do not convert custom types in
em.refresh (143a4ed), closes #7073
- core: fix applying filters on nested relation conditions (2ec6474)
- core: fix processing filters on to-many relations (4a55799)
- core: respect
orphanRemoval on 1:1 relations when inverse side is a PK (#7081) (ce4bfee)
- core: support wildcard
wrap(e).populate() hints on type level (45224ee)
- mongo: fix field name conversion when querying object embedded entities (3ea8193)
- postres: fix casting of object embedded relation properties (6095889)
6.6.3 (2026-01-04)
Bug Fixes
- core: do not connect to database when calling
orm.close() (79cabd7), closes #7041
- core: don't reset entity identifiers when using
assign on entity references (#7048) (ca5d9b8)
- core: handle custom types properly in
em.refresh (#7061) (7dc5d7d)
- defineEntity: avoid circular type inference in meta (#7039) (a18e63d)
- query-builder: do not reset schema when creating subquery for collection operators (4f4ea6d), closes #7053
- schema: ensure
SchemaGenerator respects skipTables option when diffing a schema (#7040) (40fa85a)
6.6.2 (2025-12-07)
Bug Fixes
- core: deprecate some EM and MikroORM methods (551b1df)
- core: fix joining embedded entity with virtual property (2a76b1d), closes #7023
- core: handle
BigInt in Date hydration (#7003) (236b429), closes #7002
Features
- core: use upsert when adding items to not initialized M:N collections (#7019) (268f378), closes #6625
Performance Improvements
- core: store subscribers in
Set to deduplicate them by identity (#7010) (a41c498), closes #7009
6.6.1 (2025-11-25)
Bug Fixes
- core: try to infer property types regardless of
inferDefaultValues option (98eef5e)
- mongo: fix processing of nested lazy scalar properties (94927c6), closes #6994
- mongo: respect property
fieldName on index creation (#6979) (44998c0), closes #6978
- mysql: ensure raw values are rehydrated after flush (9a86383), closes #6968
- query-builder: do not require transaction when for
LockMode.NONE (6c2a4b6), closes #6969
Performance Improvements
- core: simplify processing of scalars that use simple ORM provided type classes (15d7e74)
6.6.0 (2025-11-11)
Bug Fixes
- core: do not ignore updating the whole inlined embedded property to
null (d0913f1), closes #6966
- core: ensure base properties in STI entities won't be ignored when overridden in one child (b31ffec), closes #6957
- core: ensure original entity data are in correct shape after merging (7a30cca), closes #6951
- core: rehydrate nullable to-one properties that were discarded via filters with select-in strategy (3d58538), closes #6460
- core: support falsy values in scalar references (#6942) (a02c2a8)
- core: support type detection on classes with dots in their names like
Temporal.Instant (8cca4a8), closes #6953
- postgres: allow executing schema queries via knex in migrations (5196f24), closes #6949
- reflection: support string literal properties (#6960) (148ac75)
Features
- core: allow control over relation filters in entity definition (#6959) (28a7e44), closes #6457
- core: allow defining filters on nullable relations as strict (#6952) (1dae6cf), closes #6784 #6943 #6784
- core: allow disabling filters on relations (7798e57), closes #6457
- core: support private properties with get/set accessors (#6967) (659ca93), closes #6932
- entity-generator: allow generating enums as type or JS dictionary (#6956) (ccf24df), closes #6457
- entity-generator: support generating
defineEntity() definitions (#6954) (d523f13)
- entity-generator: support native postgres enums (#6958) (746e4bf)
- knex: reexport
raw helper that supports QueryBuilder and Knex.QueryBuilder (#6955) (897cc7f), closes #6751 #6782
- postgres: skip left joined relations from pessimistic locks automatically (ffb71a1), closes #6412
6.5.9 (2025-10-23)
Bug Fixes
- core: add some missing options to
defineEntity relation builders (#6922) (3bedcca)
- core: ensure correct state of custom typed data after merging to existing results (5907da0), closes #6926
- core: fix extra updates caused by
em.refresh (3d12a8b), closes #6940
- core: support auto-discovery of relation targets with
defineEntity (a93f2e0)
- core: support custom classes in
defineEntity relation property builders (8a03eca)
- core: update
extends type in defineEntity and EntitySchema (#6936) (589d0f3)
- postgres: do not create non-autoincrement simple PKs twice (89e139e)
Performance Improvements
6.5.8 (2025-10-13)
Bug Fixes
- core: don't skip diffing of non-hydrated properties (4a46bd8), closes #6918
- core: enhance
mapToPk() and remove default ref: true in defineEntity helper (#6919) (f0d4e8e)
- core: improve auto flush detection for STI base classes (da5e993)
- core: rework support for partial loading of embedded properties (29091aa), closes #6907
- core: support class-based entity definitions with
defineEntity (#6920) (aa7295e), closes 6865
- mongo: support indexes on JSON properties (a9edc05), closes #6899
- mongo: support upsert with nested
onConflictFields on JSON properties (4eab82e), closes #6900
- query-builder: do not ignore nested joins inside nested joins (a37d6fa)
- schema: fix down migrations with
createForeignKeyConstraint property option (23e898b), closes #6903
- schema: support raw fragments in check constraint expressions (ff360b0), closes #6914
Features
- core: improve type-level support for composite keys with
defineEntity helper (#6912) (2d39dd0)
6.5.7 (2025-10-06)
Bug Fixes
- core: enhance branded type definitions for
Opt, Hidden, Config and RequiredNullable (#6884) (6ce418d)
- core: ensure nullable ScalarReference properties are loaded as initialized ScalarReference instances (#6902) (51feb3b), closes #6885
- core: mark
autoincrement properties with Opt type in defineEntity helper (#6910) (e2a8ed4)
- core: prefer
id property over uuid property for default PK inference (7a9c834), closes #6865
- core: skip entity validation when propagating to upper context in
em.transactional (a3941a1), closes #6895
- query-builder: expand embeddable fields on select (#6896) (6b76f60)
- query-builder: support embedded fields in join conditions (#6897) (409e0ef), closes #6883
Features
- mongo: implement optimistic locking support for version properties (#6887) (591fb43), closes #3612
Performance Improvements
6.5.6 (2025-09-25)
Bug Fixes
- core: account for nullability when applying default value (#6880) (9763275), closes #6879
- core: enhance type of bigint, array, decimal properties when using
defineEntity helper (#6873) (42e7df1)
- core: ensure
em.refresh will refresh detached entities too (c156e30), closes #6867
- core: prevent stack overflow errors when populating relations on lots of entities with select-in strategy (#6874) (d5c23c7)
Features
- core: allow sha256 hashing in
FileCacheAdapter (#6866) (21d364d)
- schema: add
skipTables and skipColumns options to schema generator (#6870) (5937ab6), closes #5346
6.5.5 (2025-09-21)
Bug Fixes
- core: add missing
IncludeCount type argument to repo.findByCursor() (34c9630)
- core: correctly diff nullable properties between undefined and null (#6864) (c30d1c9)
- core: skip mapping undeclared columns that match a different property name (#6860) (b29527e), closes #6861
- schema: improve diffing of generated columns (9a59ba6), closes #6858
6.5.4 (2025-09-17)
Bug Fixes
- core: initialize collection properties after flushing an entity reference (83ca9c1), closes #6855
- core: support inference of default value from property initializer with
ref() (56e441d), closes #6853
- query-builder: fix aliasing of 1:1 inverse side when used in a filter nested inside M:N relation (61969f6), closes #6851
6.5.3 (2025-09-13)
Bug Fixes
- core: align implementation of filters in
em.find and em.count (ead5074), closes #6823
- core: export
RequiredNullable from @mikro-orm/core (#6836) (961ee74)
- core: fix propagation from
em.transactional with composite custom type PK (0b82f43), closes #6825
- core: include hidden properties when refreshing via
em.refresh() (9a7bbc3), closes #6828
- query-builder: properly wrap composite keys in join conditions (#6831) (b720ca5), closes #6830
- query-builder: skip branching on to-one joins (#6826) (65812c4), closes #6824
6.5.2 (2025-09-02)
Bug Fixes
- core: process owning sides of M:N relations in
em.assign with onlyOwnProperties (#6822) (099869f), closes #6813
- migrations: improve extraction of Migration class (2dacc4b), closes #6817
- query-builder: fix aliasing of conditions targeting a nested composite FK (b159342), closes #6819
- query-builder: fix join conditions targeting a composite FK (3f88e9b), closes #6819
- query-builder: fix processing deeply nested joins (d033729), closes #6818
- query-builder: hydrate lazy properties regardless of populate hint (8b45281)
6.5.1 (2025-08-27)
- core: add
indexName argument to index expression callback (b77c90f)
6.5.0 (2025-08-27)
https://mikro-orm.io/blog/mikro-orm-6-5-released
Bug Fixes
- core: allow querying embeddables for
null values via collection operators (d7b25a7), closes #6736
- core: do not fail version mismatch checks when getting the current version fails (086d767), closes #6765
- core: do not propagate changes to collections when partially loaded (7068b35), closes #6732 #6734
- core: ensure
em.transactional context propagation won't result in breaking identity map (2b608fc), closes #6764
- core: ensure correct runtime value of
decimal and float properties (#6807) (7cd8b1c), closes #6806 #6806
- core: fix extra updates after
em.refresh on nested entities with embeddables (640985c), closes #6705
- core: fix fetching of autoincrement PK when upserting without a unique value (0dccac7), closes #6755
- core: fix hydration with select-in strategy and PKs with custom types (#6808) (4770462), closes #6726
- core: fix querying by a nested FK as PK (c2c5bfd)
- core: hydrate persisted getters without setters unless explicitly disabled (459329a), closes #6723
- core: ignore properties with
hydrate: false from change tracking (4a6fb9b), closes #6723
- core: improve detection of empty flush (6debac9)
- core: respect joined filters in
em.count (323ffef), closes #6666
- core: respect logger context in queries from
flush and others (#6777) (083a1ee), closes #6776
- core: support cursor based pagination with
ScalarReference properties (84d20b1), closes #6793
- core: use
default for missing values in multi insert for custom types (eae635f), closes #6727
- postgres: quote string array values with
'' instead of \' (4bc1c9e)
- postgres: support
primary key with generated identity columns (382d5b3), closes #6693
- query-builder: fix
qb.leftJoinAndSelect with a subquery on M:N relations (aa52abb)
- query-builder: fix hydrating 1:1 inverse side via joined strategy (d48359c)
- query-builder: support group operators inside join conditions (#6796) (efe5a56), closes #6795
- reflection: unwrap
runtimeType to support correct hydration of scalar references (ff6a7ae), closes #5557
- reflection: unwrap
ScalarRef<T> and EntityRef<T> type (6b1a349), closes #5557
- schema: properly handle array defaults in mysql (#6703) (534193c), closes #6688
- sql: correctly handle lazy scalar properties with custom types (#6715) (c8add75)
- sql: fix computing
order by clause when ordering by a not populated relation (b8a7984), closes #6757
Features
- core: add
balanced loading strategy (#6787) (a7bff86), closes #6129
- core: add
loadOrFail to ScalarReference wrapper (#6716) (dcff19f)
- core: add
RequiredNullable helper type (#6756) (71f5153), closes 6744
- core: add comprehensive transaction propagation support (#6802) (19ebac4), closes #6788
- core: allow defining entities with inferred interfaces (#6253) (1e6961a), closes #6242
- core: allow triggering
onCreate hooks during em.create (#6263) (1a2cc2e)
- core: support
contextName in @Transactional decorator (#6719) (9ce9499)
- schema: allow disabling foreign key constraint creation, per relation (#6702) (79e6cb0), closes 2548
- schema: allow wilcard-schema friendly index expression (#6706) (688043a), closes #6446
- sql: refactor handling of filters on relations (2d1b889), closes #6760 #6784
Performance Improvements
- core: make
em.refresh faster for reloading large entity graphs (a44f671)
- sql: speed up hydration of large to-many collections with joined strategy (#6801) (5faf30c)
6.4.16 (2025-05-30)
Bug Fixes
- core: fix extra updates after
em.refresh is called on properties with custom types (6a6167e), closes #6674
- core: fix implicit serialization when multiple populate hints are present (dbf8f3c), closes #6658
- core: support custom types in
type option of version properties (bd31fb6)
- core: unlink old 1:1 relation on the owning side when changing inverse side (2f292cc), closes #6655
- core: use explicit dataloader for M:N properties (6372e4c), closes #6665
Features
- mssql: allow inserting when triggers are present in mssql tables (#6662) (efafb9b)
- query-builder: validate wrong group operator position on scalar properties (0f5ce3d), closes #6684
6.4.15 (2025-05-09)
Bug Fixes
- cli: improve detection of dependency versions for
debug command (2a8bcce)
- core: support dataloader for M:N without inverse side (#6053) (c319f1c), closes #6031 #6502 #6503
- postgres: don't lowercase native enum labels when schema diffing (469ff02), closes #6643
- query-builder: fix missing alias when joining relations via
populateWhere (6dd3ec7), closes #6635
Features
6.4.14 (2025-05-05)
Bug Fixes
- core: add support for zero count result cache (#6600) (3a8fdff)
- core: copy
EntitySchema before processing the metadata (cbf4a7f), closes #6540
- core: disallow passing array items to scalar array properties in
em.create and em.assign (1455027), closes #6609
- core: don't remove generated primary keys from entity snapshot (980e53e), closes #6593
- core: enforce correct runtime type when
object gets inferred (6e46afa), closes #6633
- core: fix
orderBy value type (06f1a72)
- core: respect
null as a valid cache result (#6585) (e3bb8e4), closes #6584
- core: respect schema option when loading missing fields on upsert (3bd72ea), closes #6622
- mssql: handle mapping for order by expressions with nulls first/last (#6618) (2cae74b)
- query-builder: don't alias formula properties in join conditions (34d1df4), closes #6620
Features
6.4.13 (2025-04-12)
Bug Fixes
- core: allow passing
null and undefined to ref() and respect it in return type (2708c7a)
- core: fix entity path discovery for bun 1.2.7 (#6564) (a749a4a)
- core: fix type of a
Record properties when mapping to EntityDTO (e4ef475)
- core: ignore collection operators in auto-joined filter conditions (c72c8c5), closes #6567
- core: make
populate parameter of em.populate() readonly (#6580) (87d8c95), closes #6579
- core: respect owner schema when persisting M:N with wildcard entities (a53765f), closes #6575
- core: skip extra populate query for nullable 1:1 inverse sides (3a72ce5), closes #6568
- mssql: ensure formula properties are not selected twice when partial loading on a joined relation (763db15), closes #6547
- postgres: fix schema diffing for
default and nullable of check constraint enums (#6572) (db9b0bf), closes #6571
- query-builder: ignore nested relation filters when applying filters to auto-joined relations (b9ac04c), closes #6566
6.4.12 (2025-04-06)
Bug Fixes
- core: clean up 1:m collections when changing the m:1 value (a720927)
- core: don't reset not selected values from existing entities (2ebc7a8), closes #6558
- core: fix populating m:n collection with custom types (444c130), closes #6477
- core: fix populating nested relations when parent entity is self referenced (285a632), closes #6531
- core: propagate composite FK values when inserting new entities (9506cae), closes #6430
- mssql: ensure
date type is mapped to string instead of Date object (098d71b), closes #6553
- postgres: fix schema diffing on m:1 relations targeting a native enum PK (a76805e), closes #6557
Features
6.4.11 (2025-03-21)
Bug Fixes
- core: fix metadata validation for polymorphic embedded properties (61bd2c3), closes #6522
- core: fix wildcard schema resolution on pivot tables (c43afa6), closes #6516
- core: respect EM schema when populating nested relations with wildcard schema (765eb69), closes #6511
- mongo: do not create migrations collection by default (#6517) (154dafc)
- mssql: fix upsert with an explicit merge array (4b57d3a), closes #6534
- postgres: cockroachdb may not require
unmarshallArray (#6501) (0661942)
- sqlite: do not ensure directory exists when
dbName is :memory: or URL (b0f97ed), closes #6533
6.4.10 (2025-03-16)
Bug Fixes
- core: fix result mapping of polymorphic embeddables which shadowed properties (4edde4c), closes #6510
- core: improve inference of the repository type (70cc33e), closes #6497
- core: improve TS detection logic (#6492) (858501d), closes #6491
- core: support nested polymorphic embeddables (18d8251), closes #6487
- mongo: ensure connection when using schema generator (4abc70e), closes #6495
Performance Improvements
- core: fix consecutive metadata discovery taking too long because of STI (f79b64b), closes #6509
6.4.9 (2025-03-07)
Bug Fixes
- core: ensure correct alias is used in complex join conditions (328c809), closes #6484
- core: fix type of virtual entity
expression callback (a13a8a0), closes #6481
- core: skip
convertToDatabaseValueSQL for missing values (63b028b), closes #6470
- core: skip TS support detection via
require.extensions (#6488) (3efdcd0)
- schema: support indexes on inlined embeddables (6689c02), closes #6469
6.4.8 (2025-03-06)
Bug Fixes
- core: do not cache internal
Collection reference to EntityManager (1c07cab), closes #6453
- core: ensure bigint types don't produce extra updates with joined strategy (70063e0), closes #6478
- core: fix serialization of collections with composite entities via
getIdentifiers (4effa18), closes #6479
- core: respect check constraints from child STI entities (8cfd6e3), closes #6450
- core: respect Collection property
orderBy when dataloader is enabled (#6467) (6322ce8)
- query-builder: apply filters to auto-joined relations (#6480) (6b1d7ee), closes #6458
- query-builder: do not inline PK nested in a
$not query (5931d28), closes #6452
- query-builder: revert recent changes to composite key sharing (2bd973d), closes #6359
Features
- entity-generator: pass through
orderBy option to the output (#6466) (1142f40)
6.4.7 (2025-02-22)
Bug Fixes
- core: enforce selection of discriminator column when partial loading is used (80c1b5b), closes #6436
- core: ensure
@Check expression callback works without explicit type (5aa77db), closes #6429
- core: ensure partial loading allows to fetch missing values (ecba90f), closes #6395
- core: fix extra updates with joined strategy caused by custom types (2e1ab9a), closes #6432
- core: fix querying by a composite property with shared columns (#6445) (396ee70), closes #6359
- core: fix support for custom types on PKs in
em.upsert (57a4549), closes #6434
- core: fix type error when getting a composite PK value (2d4d2be), closes #6430
- core: fix type resolution in
em.assign with nullable properties (4f13552), closes #6426
- mssql: fix support for upsert on compound unique constraints (#6447) (43d1ff5), closes #6390
- schema: respect schema from config in
clearDatabase() (0ab99a1), closes #6405
- sql: quote
raw().as() field aliases (d9716d7)
- sql: respect EM schema when clearing not populated 1:m collection of wildcard entities (12223e3), closes #6387
Features
- core: add
entityName as argument for filter cond callback (#6424) (f358dbf)
- core: improve typings for
@Entity, @Index and @Unique decorators (#6416) (833a640)
Performance Improvements
- reflection: only consider entity files instead of evaluating the whole project (#6439) (6f22fa6)
6.4.6 (2025-02-12)
Bug Fixes
- query-builder: fix default schema resolution when root entity has a custom schema (#6380) (746f43f), closes #6373
- sqlite: ensure correct order of columns in temp table (#6391) (fc51bd5), closes #6145
Features
- seeder: make
.each() function receive index: number argument (#6393) (8613388)
- seeder: pass params to
.definition() function as argument (#6396) (b45db20)
6.4.5 (2025-01-30)
Bug Fixes
- core: allow querying by embedded instance with
em.findAndCount (#6370) (9e60817), closes #6353
- core: ensure populating
Ref properties do not result in TypeError (7d34645)
- core: fix creating new entities with composite props that share a column (68c79b2), closes #6360
- core: fix processing of queries for composite props that share a column (c01522d), closes #6359
Features
- migrations: allow returning promise from
generateMigrationFile (af75d06), closes #6364
6.4.4 (2025-01-23)
Bug Fixes
- core: do not persist embeddables via
em.create() (c6ed010)
- core: fix multi insert when some values of a not-null column with default are missing (cd8f6e1)
- core: ignore partial loading hint on JSON column when pruning relations (fbdea0a)
- core: reduce chance of collisions of internal embedded properties (#6354) (98ab6a2), closes #6351
- query-builder: process custom types in join conditions (3a6153f), closes #6357
- schema: fixed handling of check constraints on MariaDB before 10.5.10 (#6352) (7d41e22), closes #6350
Features
- core: add
ignoreUndefined flag to assign helper (#6339) (bdcce17), closes #6338
- core: allow raw query fragments in
assign() helper data (c47ac64), closes #6346
- core: support
disableIdentityMap in em.upsert/Many() (e8e9d4c), closes #6345
- seeder: make
Factory.em protected (#6340) (e66d843)
6.4.3 (2025-01-08)
Bug Fixes
- entity-generator: output explicit
referencedColumnNames when sharing a column in a composite foreign key (85db3c1), closes #6323
- entity-generator: skip bidirectional relation if target metadata doesn't exist (#6328) (c7984fe)
- query-builder: ignore lock mode in paginate subquery and keep it only on top level (3b7fdba)
- schema: infer
columnTypes when sharing a column in a composite foreign key (6781194), closes #6323
- schema: output deferrable FKs in sqlite
create table statement (6bbec01)
- schema: support
unsigned for decimal and double types (d3ce313), closes #6318
Features
- migrations: allow configuring snapshot via env vars (59f0593), closes #6327
- mongo: include MikroORM version in MongoDB handshake (#6326) (f501a91)
6.4.2 (2024-12-22)
Bug Fixes
- core: correctly handle populate of
mapToPk relations (#6309) (61fb8f5), closes #6265
- core: fix cursor pagination with POJO cursor and relations (de1ae67), closes #6308
- core: prevent reinsertion of an entity referenced by a formula when it is removed from a collection (#6265) (8f45243)
- entity-generator: support multi-line comments (#6290) (4fdb169), closes #6286
- query-builder: combine serialization hint from managed entities and QueryBuilder result (#6307) (7d1a0dc)
- query-builder: improve detection of to-many joins in
qb.getCount() (4e5b18b), closes #6291
- reflection: fix source file detection after update to ts-morph v24 (d9716a6), closes #6297
Features
- core: validate missing properties in cursor (d175c9d), closes #6308
6.4.1 (2024-12-08)
Bug Fixes
- core: consider nested queries on JSON properties as scalars (920b019), closes #6246
- core: fix upserting properties with custom types (036b84d), closes #6241
- core: improve handling of reference wrapper inside constructor parameters (db7cb8a), closes #6266
- core: skip extra updates on properties with deferred constraints (85a649b), closes #6266
- core: support upserting entities with FK as PK when the target entity has composite PK (#6275) (2ae9ae7), closes #6252
6.4.0 (2024-11-11)
https://mikro-orm.io/blog/mikro-orm-6-4-released
Bug Fixes
- core: add missing
getterName option (aa18e57), closes #6127
- core: allow upserting POJO with embeddded instances (159fd4a), closes #6198
- core: check that inverse side exists when mapping collection items via dataloader (#6149) (f580598), closes #6148
- core: ensure decimal type that maps to number won't produce extra updates (cc67ca4)
- core: fix double processing of custom types in
em.nativeUpdate (1b39846), closes #6206
- core: fix explicit serialization typing via
wrap().serialize and BaseEntity.serialize (d93b325)
- core: ignore collection properties when entity constructors are enforced (78a5937)
- core: improve comparison of decimal values (66e60cb), closes #6194
- core: improve error handling for comparing invalid dates (#6120) (1aa940b)
- core: pass correct values to constructor for props using custom types (58c8ce4)
- core: rename
tsNode option to preferTs (#6214) (194f511)
- core: revert workaround for
Date properties in clone() helper (c1af3db), closes #6118
- core: use db value for identity map key of PKs with custom type (aa1dd3c), closes #6150
- entity-generator: output inverse sides for pure pivot tables when outputted (#6196) (e4b048b), closes #6192
- mssql: map property names to field names when processing composite keys (cf687e8), closes #6204
- postgres: make upsert where conditions fully qualified (b4b3cab), closes #6203
- postgres: return all results for multi statement raw queries (adcef5f), closes #6009
- postgres: support
raw fragments in qb.distinctOn() (f8580c8)
- query-builder: fix detection of raw fragments in update queries with not matching field names (22b918f), closes #6177
- query-builder: fix serialization of nested relations (3850c1e), closes #6194
Features
- core: add
@Transactional() decorator (#6143) (babe4da)
- core: add
onQuery hook (#6200) (6f98b3c)
- core: add
prefixMode option to embeddables (#6113) (5df26e1), closes #6112
- core: allow defining multiple named configurations in one config file (#6201) (cecea34), closes #6067
- core: improve support for sharing columns in multiple properties (05318c1)
- core: schedule orphan removal on old 1:1 relations regardless of their init state (fc9a1c1), closes #5213
- core: upsert managed entities (#6197) (a3b5e57), closes #6055
- core: validate non-persistent relations are not composite (#6216) (16c8b48)
- entity-generator: added support for forceUndefined being false (#5849) (e0ce840)
- migrations: allow passing list of classes to
migrationsList (#6102) (35d84ac), closes #6099
- migrations: allow subscribing to migrator events (18a425c), closes #5763
- mssql: add support for smalldatetime type (#6128) (998509b), closes #5904
- query-builder: add
qb.andHaving() and qb.orHaving() methods (c36d4c8), closes #5796
- query-builder: allow joins on update queries (782e227), closes #6150
- schema: diff foreign keys also by the constraint name (93ade9d), closes #6146
Performance Improvements
6.3.13 (2024-10-06)
Bug Fixes
- core: add child
SerializeOptions to custom serializer parameters (dbfddce), closes #5968
- core: fix partial loading on to-many relations (224613f), closes #6097
- core: fix same-second dates diffing (#6094) (cd7ce82)
- core: fix validation for not discovered entity trigger from
Collection access (4834920)
- core: ignore non-persisted properties on embeddables (#6107) (e688694), closes #6105
- core: respect joined filters on
em.count() (#6115) (4f0bde5)
- core: revert making the
$and/$or arrays readonly (0e0667c), closes #6085
- postgres: improve schema diffing for native enums with explicit schema (#6114) (fa537b1), closes #6101
- query-builder: fix support for update/delete with nested where conditions (3a451e1), closes #6103
- query-builder: improve intellisense on several QB methods (32113b0)
- query-builder: use the correct PK field name for inserts without explicit values (8706f04)
Features
- core: improve error message when only abstract entities are discovered (3835e40)
Performance Improvements
- core: simplify lookup of returned values from batch updates (6caa82a)
6.3.12 (2024-10-01)
Bug Fixes
- core: accept
readonly arrays in operator where conditions (#6085) (1ab24fe)
- core: prevent conversion of
many entities in oneToMany from extractConstructorParams (#6093) (8ba8d7a), closes #6092
- mongo: ensure
Date properties are correctly cloned and persisted (8d81985), closes #6078
- mongo: fix persisting objects like
ObjectID in JSON properties (#6091) (c28f06f), closes (#6050)
- mongo: fix populating lazy M:N owning sides (f7e90cb), closes #6079
- query-builder: ensure cached
execute('get') returns a single result instead of an array (#6084) (d2da8d0), closes #6083
- query-builder: ensure correct return type for
qb.execute() (f48e544), closes #6089
6.3.11 (2024-09-26)
Bug Fixes
- core: fix diffing of object properties (55df57f), closes #6050
- core: fix partial loading with
* on joined strategy (1f0dbd4), closes #6045
- core: properly detect when Windows imports need patching (#6035) (a6c4dea)
- core: skip extra query when loading inverse side of 1:1 relation with a filter (ccf099f)
- core: support atomic updates on properties with custom types (951284b), closes #6030
- core: support multi update on mixed STI entities (e1deb0d), closes #6069
- migrations: use ORM logger and respect
loggerFactory (e845c26), closes #6039
- postgres: improve timezone handling for negative timezone offsets (52a503c)
- postgres: set max identifier length to 63 characters (5b866fa), closes #6042
- schema: ensure
CREATE TABLE DDL for tinyint/smallint/mediumint primary keys (#6065) (e2738cc)
- schema: ensure
unsigned: false works for primary keys (#6063) (f14a6b4), closes #6057
- schema: resolve missing auto_increment for PK in
MySQL/MariaDB update DDL (#6073) (984758f), closes #6072
Features
- core: load root entities via
em.populate() (b7c3f69), closes #6032
- mongo: improve error logging for
ensureIndexes (faa2a00), closes #4486
Performance Improvements
- core: reduce nesting of
toPOJO() serializer (4b263f3)
6.3.10 (2024-09-15)
Bug Fixes
- core: allow accessing PK props on
Ref properties with partial loading (32d588d)
- core: fix dynamic imports on Windows (#6020) (e697ec2)
- core: fix mapping of version properties from batch updates (ec521c9), closes #6016 #6022
- core: respect context name in
@EnsureRequestContext() (4574831)
- core: support dynamic discovery via
EntitySchema (3fde7d4), closes #6026
- migrations: support multiline strings in
addSql() (#6017) (bc14925), closes #6015
- mongo: support partial loading of M:N owning sides (#6027) (e53a7d9)
6.3.9 (2024-09-09)
Bug Fixes
- core: allow proper select with embedded many to many (#5997) (8b30ae2), closes #5992
- core: fix expansion of array conditions to
$in operator for raw values (59c627e)
- core: fix hydration of datetime when provided a ISO string value via
em.create() (2992046)
- core: implement joined filters via
populateFilter option, separately from populateWhere (#6003) (9d0a022), closes #5893
- mongo: allow ordering by object embedded properties (2a9ffa3), closes #6002
- postgres: fix casting of JSON values when used with
$in operator (840d3cd), closes #6000
- postgres: fix diffing vector columns without length (2f7a7fb), closes #6008
6.3.8 (2024-09-04)
Bug Fixes
- core: check proptotype chain while cloning (#5979) (d5eeee5)
- core: fix populating lazy scalar properties inside embeddables (ffcd0e0), closes #5956
- core: improve support for embeddables in
em.upsert() (78dbeed), closes #5969
- core: infer runtime type based on
new Date() property initializer (ed0560b)
- core: support collection operators with non-standard primary keys (171793f), closes #5989
- postgres: fix parsing of
timestamptz values with negative timezone (8ccc925)
- schema: change default of
disableForeignKeys to false (#5993) (8a8aa2d)
6.3.7 (2024-08-28)
Bug Fixes
- core: don't double encode JSON properties inside object/array embeddables (f3321f9), closes #5963
- core: fix hydration of collections with
forceEntityConstructor enabled (d4d8506), closes #5972
- core: provide entity instance in object constructor params for m:1/1:1 properties (fe2d129)
- core: respect context in EM transaction methods (8912185)
- core: respect entity level
forceConstructor option (c642a49)
- query-builder: ensure the correct order of parameters when handing nested joins (10a858d), closes #5955
- sql: correct cursor conditions application on virtual entities (#5973) (fc782d3)
6.3.6 (2024-08-14)
Bug Fixes
- core: ensure other conditions do not override collection operator conditions (97cdc9d)
- core: fix hydration of polymorphic embeddables with overlapping property names (ab5c595), closes #5935
- postgres: do not cast
json columns to text (574390b), closes #5936
- schema: recreate FKs when changing column type (8797c64)
6.3.5 (2024-08-11)
Bug Fixes
- core: track changes on non-scalar properties (a02c727), closes #5750
- entity-generator: ensure
columnType is emitted correctly and when necessary (#5930) (72333ad), closes #5928
- entity-generator: fix the search for FK indexes to only match exact columns, not "at least" (#5924) (05a8808), closes #5912
- entity-generator: unknown type defaults always use default/defaultRaw, never runtime (#5927) (dcc8227)
- postgres: allow string value for
$overlap/$contains/$contained operators (6c1b12a)
- postgres: detect native enums with same name but different schema (31735e5), closes #5905
- postgres: do not produce extra updates for fulltext properties (d18e5ed), closes #5908
- postgres: respect
timezone option and interpret timestamp columns in UTC by default (#5916) (1da0722), closes #5591
- sql: support cursor-based pagination on virtual entities (b86799c), closes #5922
Features
- cli: detect
bun when checking for TS support (e87ebc9)
- core: add
RequestContext.enter() which uses ALS.enterWith() (dc06f60)
6.3.4 (2024-08-06)
Bug Fixes
- core: adjust collection owner's serialization context when lazy-loading (#5903) (57f234b), closes #5559
- core: do not convert bigints with mapping to
number to string on serialization (ee24f1f), closes #5839
- core: fix populating lazy properties inside inlined embeddables (8d1e925), closes #5848
- core: merge enum items from STI entities with the same name (06fffbd), closes #5807
- migrations: use
override keyword in TS migration files (d2f7b83), closes #5634
- mssql: convert tuple comparison queries to simple
and/or conditions (#5906) (c3c3519)
- query-builder: do not return itself from
qb.applyFilters() (6be2603)
- schema: respect check constraints from base entities (22b7e97)
- sqlite: allow tuple comparison (3caa50a)
6.3.3 (2024-08-03)
Bug Fixes
- core: ensure
@CreateRequestContext() works when invoked from explicit transaction (de0b515)
- core: fix unnecessary populate query when partial loading via joined strategy (33da574), closes #5889
- knex: update
PoolConfig interface to match what knex supports (#5892) (eb5d4a1)
- knex: use nested join for
populateWhere condition (#5893) (24e82c7), closes #5872
- query-builder: fix processing of nested condition when there is a collection in embedded field names (6bf635b), closes #5894
- reflection: respect
outDir when finding the source file in production build (fe54d45), closes #5536
Features
- query-builder: add
qb.applyFilters() method (0aaaa4f), closes #4876
6.3.2 (2024-08-01)
Bug Fixes
- core: fix cancelling orphan removal on m:1 relations (7b30844), closes #5884
- core: fix overriding not initialized 1:m collection without orphan removal (517108b), closes #5883
- reflection: fix type inference when intersecting with
Opt or Hidden (951c805), closes #5881
6.3.1 (2024-07-25)
Bug Fixes
- core: always check TS config files if TS support is detected (eb100fe), closes #5852
- core: discover base entities first to fix detection of STI when root entity not explicitly listed (7c1976f)
- core: fix CreateRequestContext not working with callback returning EntityManager (#5873) (3de546d), closes 1#L132
- mssql: do not escape charecters that don't need escaping (#5860) (6730978), closes mikro-orm#5811
- mssql: do not escape new line character (97919ce), closes #5811
- schema: skip db default inference only for polymorphic embeddables (925c69e), closes #5847
Features
6.3.0 (2024-07-18)
https://mikro-orm.io/blog/mikro-orm-6-3-released
Bug Fixes
- cli: enforce
moduleResolution: 'nodenext' for CLI context (d5d7f38), closes #5514
- core: allow
em.transactional handler to be synchronous (#5696) (fd56714)
- core: allow passing
null to optional properties in em.create() (df0db99), closes #5827
- core: ensure correct identity when upserting without primary key (cdbab12), closes #5702
- core: ensure correct mapping of related columns to owning entity fields for complex relations (#5630) (302600e), closes #5629
- core: ensure correct mapping to native bigint in sqlite and mysql (a16b801), closes #5737
- core: fix auto flush mode for
em.count() (62db127)
- core: fix auto flush mode for
em.findAndCount() (a572869)
- core: fix batch update of nullable embedded arrays (c1ea284), closes #5723
- core: fix detection of constructor parameters with default object value (58e8c2a), closes #5710
- core: fix handling of pivot entities with M:N relations (fa89731), closes #5774
- core: fix handling of raw query key of where condition with
[] on right side (1e76509), closes #5825
- core: fix populating entity graph with cycles (6505510)
- core: fix processing of nullable embedded arrays (01612a1), closes #5715
- core: ignore existing contexts in
@CreateRequestContext() (1bb4e22), closes #5801
- core: improve handling of JSON properties to support numeric strings in all drivers (#5780) (fc50c5f), closes #5773
- core: make
raw() accept readonly params (#5832) (7f9daf7)
- core: respect
populate option in Reference.load for loaded relations (04fb826), closes #5711
- core: respect
populateOrderBy with select-in strategy (3b83d29), closes #5693
- core: respect nullability of wrapped types for ScalarReference's (#5722) (a1b8f07)
- core: respect parent property prefix when child has
prefix: false (94367b8), closes #5642
- core: support for TS 5.5 (2fd7359)
- core: support overloading embedded properties (#5784) (c57b528), closes #2987
- core: use
NonNullable instead of the internal Defined type (8ef28c4)
- core: use the same transaction context in
em.refresh() (dd17706), closes #5753
- core: using EntityData<Entity, true> now works with IType (#5810) (f339ef5)
- entity-generator: correctly serialize string prefixes in embedded references (#5826) (7882bca)
- entity-generator: fix handling of primary keys that are foreign keys or enums (#5673) (b10413f)
- entity-generator: fixed default values for enums (#5765) (58d914d)
- entity-generator: generate all bidirectional relations in case of conflicts (#5779) (af845f1), closes #5738
- entity-generator: include all entity options in EntitySchema definitions (#5674) (94ef44e)
- entity-generator: output all DB related info even for virtual properties (#5817) (845b75c)
- entity-generator: output entity and prop comments (#5699) (4ef21c4)
- entity-generator: support complex enum names and values (#5670) (7dcb7be)
- entity-generator: when using esmImport, FKs are now wrapped with Rel (#5771) (c28ab16)
- mssql: add proper support for MSSQL's native "varchar" type (#5685) (0b514ce)
- mssql: fix handling of non-UTC timezones (e78696c), closes #5695
- mssql: only escape strings and unicode strings when necessary (#5786) (b4e0914), closes #5811
- mysql: fix support for older MySQL versions than v8.0.13 when reading indexes (#5654) (3c4f665), closes #5653
- postgres: implement diffing support for
vector type (9eadac1), closes #5739
- postgres: put new native enum values into the correct position (f79e3bc), closes #5791
- postgresql: ignore tables that use inheritance during schema diffing (#5648) (55f452a)
- postgres: respect empty string in enum items (c02f12e), closes #5751
- postgres: support enum arrays with special characters (54b30cb), closes #5781
- query-builder: don't use alias in more complex queries when not needed (#5679) (ad347e7), closes #5676
- query-builder: interpolate raw query params early to ensure the correct binding position (9bd0fe9), closes #5706
- query-builder: process raw query fragments under operator value (98510a3), closes #5724
- query-builder: quote alias in formulas when joining virtual relations (68b64ec), closes #5705
- query-builder: skip inner select for properties that map to a raw query fragment during pagination (1c5154a), closes #5709
- schema: always prefer index/unique expression (96dff53), closes #5668
- schema: do not drop FKs in down migrations when they are disabled (0dcfa80), closes #4993
- schema: skip implicit FK index when defined explicitly by user on entity level (ff6bfdc), closes #5725
- sql: fix ordering by m:1 and 1:1 relations with joined strategy (28119c6)
- sql: ignore generated columns when computing changesets (55dfbf9), closes #5660
- sqlite: fix altering tables via malformed temp table (#5683) (1b9087c), closes #5672
- sql: rework detection of problematic batch updates and split more aggressively (b045033), closes #5656
Features
- cli: always check TS files regardless of
useTsNode (#5650) (7c34416)
- core: addz
Platform.getDefaultVarcharLength and optional Type.getDefaultLength (#5749) (29dcdeb)
- core: allow passing
raw() into onConflictFields of upsert methods (#5691) (bff90f2), closes #5668
- core: allow upserting without a unique value (#5726) (75a4706)
- core: check for ORM extensions dynamically (#5651) (68a3c1f)
- core: implement "character" type (DB type "char") (#5684) (9fa5fad)
- entity-generator: add a coreImportsPrefix option (#5669) (b9ab69a)
- entity-generator: added option to output pure pivot tables (#5809) (832a626)
- entity-generator: added the ability to add extra names to be imported (#5797) (82696b3)
- entity-generator: allow custom types for scalar relations (#5435) (a8a9126)
- entity-generator: enable the generator to dictate import specs via
extraImport (#5772) (effd9fb)
- entity-generator: repository class reference can be added from hooks (#5785) (44a49a9)
- entity-generator: support adding groups through metadata hooks (#5793) (a756271)
- libsql: support connecting to remote turso database (#5764) (6255a33)
- migrations: allow initial migration to be blank if no entities are defined (#5802) (a8f6864)
- migrations: make
--blank also generate a down migration (#5657) (056d336)
- postgres: allow specifying deferred mode on unique constraints (#5537) (7672b56)
- postgres: support
on delete set null/default with subset of columns (5353e6a), closes #5568
- postresql: add support for varchar with unlimited length (#5707) (c22e971)
- query-builder: infer
Loaded hint based on joinAndSelect calls (#5482) (d18da6b)
Performance Improvements
- core: improve serialization speed (136f704)
- core: rework
EntityKey type to improve tsserver performance (#5762) (dabe734), closes #5708
6.2.9 (2024-05-31)
Bug Fixes
- cli: use
module: 'nodenext' when registering ts-node (#5514) (8695524), closes #5427
- core: detect path from decorator for each class only once (#5545) (9af0e38)
- core: improve support for
clientUrl with additional query parameters (1472705), closes #5608
- core: improve support for sharing columns in composite PK and FK (#5623) (7190879), closes #5622
- core: improve validation for missing
dbName when clientUrl is provided (c21359e)
- core: respect
ignoreNestedTransactions from upper context (eab4df6), closes #5585
- core: use explicit
NoInfer type helper to support TS<5.4 (c38b366), closes #5613
- knex: explicitly declare all the extended drivers as optional peer dependencies (#5647) (64045ad)
- mssql: account for quotes in table names (#5637) (0343609)
- mssql: fix creating migrations due to a missing helper method (#5644) (90e27c2), closes #5633
- mssql: fix creating schema for migrations table (fe1be6f), closes #5644
- mssql: fix ensuring the database exists on older SQL Server versions (f0a5790), closes #5638
- postgres: respect
deferMode option in 1:1 relations (#5641) (101c0a8)
- reflection: detect complex runtime types and don't use them as column types (0c8a587), closes #5601
- reflection: support entities compiled by babel (#5628) (26f627e), closes #5610
- schema: fix diffing renamed indexes and columns when the names are not lowercase (4019dc3), closes #5617
- sql: implement batching of M:N collection update queries (d97979b), closes #5627
Features
- core: allow overriding the
--config argument name (8b304ab)
Performance Improvements
- sql: optimize diffing M:N collection state (f46e7c8), closes #5627
6.2.8 (2024-05-21)
Bug Fixes
- cli: disable eager connection when creating the ORM instance (ef5d14a), closes #5030
- core: allow hydration of non persistent embedded properties (#5579) (e8c0c3f), closes #5578
- core: always use root entity when computing M:N field names with STI (568e57f), closes #5586
- core: map embedded constructor parameters (24f3ee6)
- postgres: support
lockTableAliases with explicit schema name in config (3fdb077), closes #5125 #5404
- schema: use
type as columnType when no matching mapping found (cd7f85c), closes #5587
- sql: respect
timezone when mapping joined properties to Date (7f9bb0b), closes #5577
6.2.7 (2024-05-18)
Bug Fixes
- core: fix ordering by joined embedded object properties (cbd7c3e), closes #5560
- mongo: ensure JSON values are properly diffed (577166a), closes #5572
- query-builder: improve handling of nested
$and/$or queries (567d65a)
- schema: revert the
dbName after dropping the database (725f7e9), closes #5583
6.2.6 (2024-05-14)
Bug Fixes
- core: fix mapping of
Date properties from bigint values (05c802b), closes #5540
- core: quote column name for the returning statement when using
convertToJSValueSQL (4783945), closes #5563
- core: respect
runtimeType override with reflect-metadata provider (f1c9740)
- query-builder: don't remove joins used by other joins during pagination (#5566) (b05c434), closes #5565
- reflection: allow inference of
Ref<boolean> & Opt (534f088), closes #5557
- sqlite: fix mapping of joined results with
DateTimeType properties (4001d2b), closes #5550
6.2.5 (2024-05-05)
Bug Fixes
- core: fix extra updates on embedded array properties (48fde11), closes #5530
- core: fix hydration of relations with custom types via joined strategy (07f10c8), closes #5518
- core: improve support for mapping
DecimalType to number (5a3e30e)
- core: limit depth in custom
inspect methods to get around debugging issues in vscode (f706c06), closes #5525
- core: support path detection from decorators in bun (6683bcc), closes #5496
- mongo: support cursor pagination on
Date properties (4281320), closes #5496
- mysql: infer unsigned value for FKs based on the target PK (b7ae145), closes #5485
- query-builder: do not reset join conditions when paginating (0b851e5), closes #5538
- schema: skip extra columns in nested pivot entities (f34e4d7), closes #5276
Features
- core: allow specifying the
runtimeType explicitly (e9c0c07)
6.2.4 (2024-05-02)
Bug Fixes
- core: do not issue extra updates when there are no matching changesets (03934d0), closes #5510
- core: fix extra updates with
forceEntityConstructor and JSON properties (5ef57b6), closes #5499
- core: keep transaction context when forking for
disableIdentityMap (ed88a02), closes #5527
- core: keep transaction context when forking for
disableIdentityMap (8d4fe98), closes #5528
- core: support
onCreate with ScalarReference properties (09e5ca8), closes #5506
6.2.3 (2024-04-24)
Bug Fixes
- core: fix handling of
first/last: 0 with cursor-based pagination (508389e), closes #5501
- core: ignore upsert with inlined embedded properties (7d2bed6), closes #5500
- migrations: fix reading migration snapshot (096dcee), closes #5497
- query-builder: do not prune join branches when paginating and there are raw fragments in select clause (4d0fe15), closes #5490
6.2.2 (2024-04-20)
Bug Fixes
- core: do not enforce
require() when running via ts-jest or on JSON imports (7e8409b), closes #5461
- core: fix folder-based discovery for multiple entities in single file (#5464) (d64be7e)
- core: ignore serialization options when using
toPOJO() (#5481) (46d6eb4), closes #5479
- migrator: store snapshot only after migration is generated (#5470) (65ec57c)
- mssql: declare
import types explicitly (02494bf), closes #5462
- mysql: fix reading
auto_increment_increment value (1da88af), closes #5460
- postgres: support wildcard native enums (e183de3), closes #5456
Features
- entity-generator: extend filtering options for EntityGenerator (#5473) (0894ac9), closes #5469
- query-builder: allow returning promise from virtual entity
expression (ee98412), closes #5475
6.2.1 (2024-04-12)
Bug Fixes
- core: skip 1:1 owner auto-joins for lazy properties (6442e57)
- knex: rework postgres and mysql dialect imports to fix compilation errors (ffdca15)
- mssql: support instance names in
host (dc7dc4c), closes #5441
- query-builder: do not ignore unmatching partial loading hints in
qb.joinAndSelect (ccdf018), closes #5445
- query-builder: fix partial loading via
qb.joinAndSelect with explicit aliasing (da68503), closes #5445
- query-builder: generate join on condition for subquery joins with known property name (3dfbbde), closes #5445
- query-builder: respect collection property where conditions (declarative partial loading) (3b4fc41), closes #5445
6.2.0 (2024-04-09)
https://mikro-orm.io/blog/mikro-orm-6-2-released
Bug Fixes
- core: do not select 1:1 owning FK twice (fa69276)
- core: fix querying by embedded properties inside relations (2e74699), closes #5391
- core: fix support for custom repositories in
@CreateRequestContext on type level (aacac83)
- core: fix TypeError when ordering by embedded populating properties (2c472ab), closes #5389
- core: ignore current context when creating repository instance (4c12fc5), closes #5395
- core: prefer entity type inference from the first parameter of entity manager methods (523963b)
- core: respect custom
EntityManager type in em.fork() (bb1a3f9), closes #5415
- core: support passing
Configuration instance to MikroORM.init (54a37d0), closes #5413
- entity-generator: allow arbitrary class and prop names as identifiers (#5359) (b0c0236)
- mariadb: rework pagination mechanism to fix extra results (a57cb19)
- mysql: support
order by nulls first/last for raw query fragments in order by keys (a2a8f0d)
- postgres: drop text enum check constraints only when necessary (#5414) (5162345), closes #4112
- postgres: removed erroneous duplicates in FK discovery query (#5376) (eec2b38)
- query-builder: fix serialization hint of nested
qb.joinAndSelect() calls (c2843b9)
- schema: improve detection of renamed columns (4d13c58)
- schema: rework dropping columns to support custom schemas and merge drop column queries (255f425)
Features
- core: add support for serialization groups (#5416) (818c290)
- core: allow better type-safety for custom types via
IType (#5383) (0e18346)
- core: allow configuring
driverOptions on replica level (05e81f8)
- core: include all dirty collections to
UoW.getCollectionUpdates() (e7bd66f)
- core: make
assign options configurable globally (bc9f6f5), closes #5410
- libsql: add libSQL driver (#5417) (6c63e4b), closes #5283
- mssql: add MS SQL Server driver (#1375) (eeaad45), closes #771
- postgres: allow defining deferred FK constraints (#5384) (f42d171), closes #5306
- query-builder: add
limit 1 when executing query via getSingleResult() or execute('get') (c2b22e8), closes #5379
- query-builder: add
qb.getLoggerContext() and qb.setLoggerContext() (779fa15), closes #5358
- schema: allow configuring
updateRule and deleteRule for pivot tables (cc69c3c)
- schema: improve
orm.schema.execute() to support executing batches (3c5a347)
- schema: support recreating the whole database via
orm.schema.refreshDatabase() (2e4ab49)
Performance Improvements
- core: optimize metadata discovery (c322f9b)
- query-builder: remove unnecessary join branches when pagination is applied (d228976)
6.1.12 (2024-03-24)
Bug Fixes
- core: fix assignability of partially loaded entities (9de4965), closes #5374
- core: fix inlining of
$and conditions (8ddb3e4), closes #5368
- entity-generator: try to resolve errors for foreign keys without indexes (f2094ab), closes #5364
- postgres: fix query for loading all foreign keys from existing schema (2eb85d5), closes #5364
- reflection: fallback to not proving path to tsconfig if not found (a24d80d)
Features
- cli: add reason for failed connection check in
debug command (d61e248)
- core: allow passing
EntityManager or EntityRepository to @CreateRequestContext decorator (184cdd4)
- postgres: add
?, ?| and ?& json operators (#5366) (6418872), closes #4678
Performance Improvements
- postgres: try to optimize loading of foreign keys (2dff96b), closes #5364
6.1.11 (2024-03-18)
Bug Fixes
- core: improve serialization of lazily partially loaded entities (1c7b446), closes #5139
- core: support unsetting composite FKs via flush (64f2afd)
- migrator: type mismatch between Migration interface and class (#5343) (2fba5ee), closes #5340
- query-builder: fix aliasing of FK when used in deeply nested and/or conditions (ebb966c), closes #5086
- reflection: respect custom tsconfig options (e8cfdc0)
- sql: fix aliasing of nested composite FK queries (60b2c91)
6.1.10 (2024-03-14)
Bug Fixes
- core: detect
ts-node when using esm loader (#5332) (23cc880)
- core: don't alias formulas in update/delete queries (9e35642), closes #5334
- core: fix populating references for 1:m collections (9b9027d), closes #5336
- core: fix value of
hasPrev[/Next]Page when paginating backwards (#5320) (00239eb)
- postgres: fix diffing of native enums (create/remove via
schema:update) (7c8be79), closes #5322
- query-builder: allow joining object/array properties (fd90bae), closes #5325
- query-builder: fix
join on conditions where or operator (92936ef)
- schema: support compound index over JSON property and a regular column (319df49), closes #5333
- sql: allow creating query builder from a global context (9217bb3)
- sql: override FK value when it's disallowed by query condition (0d20847)
Features
- core: add
onlyOwnProperties option to assign helper (#5330) (a081bea), closes #5327
- postgres: provide more details in driver exceptions (e782d06)
Performance Improvements
- core: disable change tracking on scalars when
flushMode is not auto (fc30bfe)
6.1.9 (2024-03-10)
Bug Fixes
- core: don't propagate changes from
em.transactional() to upper context if its global (7ac9a19), closes #5309
- core: ignore filters on relations inside embedded properties (1e4b2ce), closes #5310
- core: improve checks for generated columns (0396e1e)
- core: map virtual relations with
persist: false as formulas to preserve aliasing (20a4cfb)
- entity-generator: emit missing imports in
EntitySchema generated files (#5311) (f680d66)
- entity-generator: output type import statements for type only core imports (#5317) (bd3f160)
- migrator: allow
up and down methods to be synchronous (#5316) (dd6daf9)
Features
- postgres: add support for native enum arrays (c2e362b), closes #5322
6.1.8 (2024-03-06)
Bug Fixes
- core: allow setting values to
null on unloaded references (1cbead6), closes #5274
- core: fix bulk-inserting entities with nullable embedded arrays (f16551e)
- core: skip STI discriminator condition when bulk-deleting entities (fa712ca), closes #5303
- query-builder: fix
qb.getResultAndCount() when pagination is triggered (67444c0)
6.1.7 (2024-03-04)
Bug Fixes
- core: add
em.addFilter() fallback signature that allows more than 3 types (b6efd44)
- core: fix aliasing of queries with collection operators (0435faf), closes #5301
- core: ignore collection operators in
populateWhere conditions (7b6b363)
- query-builder: check for duplicate selects when wrapping pagination query (e005cc2)
- query-builder: fix cloning of alias map (50d8fb9)
Features
- core: validate wrong placement of collection operators (c35e705)
6.1.6 (2024-02-28)
Bug Fixes
- core: don't refresh collection state via
Collection.load() (f5be639), closes #5268
- core: fix type of
options parameter in repository.upsert/Many() (4c12e7f)
- core: support raw fragments in
orderBy of 1:m and m:n relations (ed80163), closes #5277
- mysql: apply current context when fetching
auto_increment_increment (#5280) (c8021da), closes #5279
Performance Improvements
- core: improve composite PK hashing (73094ef)
- core: improve hydration of simple FKs (c4bd1f0)
- core: optimize adding entities to large collections (8a960d5)
6.1.5 (2024-02-21)
Bug Fixes
- core: allow serializing raw SQL fragments outside of entity serialization (9158f51), closes #5257
- core: ensure missing type validation ignores enums (a916710), closes #5255
- core: fix
orderBy option on to-many properties with arrays (fae2302), closes #5265
- core: ignore virtual properties in partial loading hint (d327db5), closes #5261
- entity-generator: fixed generation of unsigned columns (#5254) (d78da29)
- entity-generator: optional and hidden properties get type option + string defaults (#5264) (12d3b54), closes #5260
- schema: allow 1:m properties in pivot entities (c370578)
6.1.4 (2024-02-16)
Bug Fixes
- core: fix populating 1:1 inverse sides when virtual FK is not selected (46cb6a1), closes #5245
- entity-generator: use
Ref wrapper on all lazy properties (#5252) (50311cb)
- query-builder: fix caching of raw query fragments when
qb.getQuery() is called (f79a752), closes #5247
Features
- entity-generator: added support for generated columns (#5250) (d2186da)
6.1.3 (2024-02-13)
Bug Fixes
- core: fix extra updates when embedded property name matches inner field name (e008dab), closes #5240
- core: fix validation for removing items from 1:m collections (34b8473), closes #5243
- postgres: implement casting for JSON queries on types like
double or bigint (b00eae6), closes #5239
Features
6.1.2 (2024-02-11)
Bug Fixes
- core: allow multiple abstract levels for STI entities (0c56118), closes #3745
- core: respect user provided env vars over those from
.env file (e25ca11)
Features
- entity-generator: add the ability to use custom and/or core base entity (#5232) (066dac1)
6.1.1 (2024-02-10)
Bug Fixes
- core: consider star populates on nested positions only for one level (65d1575), closes #5213
- core: do not enforce
discriminatorColumn type (d2a016e), closes #5224
- core: fix change detection on STI entities (3c43251), closes #5224
- core: fix optimistic locking on STI entities (36ad806), closes #5224
- core: respect star in
parent.* populate hints (39910ab), closes #5213
- postgres: declare dependency on
postgres-array (e73fd1a)
- postgres: fix parsing of date properties inside object embeddables (760ec77), closes #5216
- reflection: only validate known types to allow using type aliases (d6b93be), closes #5221
Features
- entity-generator: support functions in extension hooks (#5218) (b28321c)
6.1.0 (2024-02-04)
Bug Fixes
- core: allow
CacheAdapter.get to return Promise<undefined> (#5200) (98ce1e5), closes #5199
- core: fix broken inference of
AutoPath in TS 5.4 (#5197) (8bbc252)
- core: handle possible match between virtual property name and another property's field name (7fc779f), closes #5191
- core: make
wrap(e, true).__em correctly typed to EntityManager (35d607c)
- core: process upsert data to allow using entity instances in place of relations (9305653), closes #5165
- core: respect
upsertMany options when batching (d6d1381), closes #5209
- core: respect hidden properties of composite PKs during serialization (3d1cba3), closes #5203
- postgres: improve diffing of native postgres enums (49d6b4d), closes #5108
- query-builder: support
convertToJSValueSQL on returning statement of update queries (2e1d6c8), closes #5176
Features
- core: add second EM parameter to
onCreate and onUpdate callback (a964aeb), closes #5201
- core: allow declarative partial loading of collection items (#5210) (5e4fa60), closes #4963
- core: allow mapping array columns to arrays of objects via
ArrayType (#5204) (42cc9cc), closes #5188
- entity-generator: allow post processing the metadata (#5113) (e82058f), closes #5010
- knex: add
loggerContext parameter to em.execute (b6d46df)
6.0.7 (2024-01-30)
Bug Fixes
- core: consider
PrimaryKeyProp as optional properties for em.create() (69522f2), closes #5187
- core: do not add
undefined to null types in EntityDTO (d661c68), closes #5186
- core: fix ignoring function properties when they are optional (fb33934)
- reflection: fix validation of string enums when loading via
QueryBuilder (908864c), closes #5185
Features
- postgres: add support for
interval type (659a613), closes #5181
6.0.6 (2024-01-29)
Bug Fixes
- core: ensure
em.insertMany returns array of PKs for a single item too (#5180) (0d58aaf), closes #5179
- core: fix TypeError caused by validation of duplicate field names (01d8c26), closes #5163
- core: make PK properties non-nullable in
EntityDTO (dc4fc6f)
- core: respect optionality in
EntityDTO type (1691a79)
- core: validate missing populate hint for cursor based pagination on relation properties (ea48db0), closes #5155
- mongo: ensure
assign on object properties won't ignore changes (a360300), closes #5158
- query-builder: only map the first result with
qb.getSingleResult() (0e56fe1), closes #5182
6.0.5 (2024-01-18)
Bug Fixes
- cli: try to respect windows ESM binary (57e91e2), closes #5147
- core: do not infer
populate: ['*'] from fields: ['*'] (f658376), closes #5139
- core: do not mutate data provided to
em.upsert/Many (3d8c242), closes #5136
- core: don't convert mapped types for constructor parameters when creating new entity (37befd3), closes #5150
- core: fix bigint mode detection when hydrating new entity from returning statement (a42321d), closes #5146
- core: merge serialization hints when lazy populating (f1d2487), closes #5138
- query-builder: cache knex QB instance to get around issues with raw fragments (f6e76d8)
- reflection: improve detection of
Ref types with FK as PK (c8858d2), closes #5144
6.0.4 (2024-01-15)
Bug Fixes
- core: respect reloaded properties of partially loaded entity during serialization (f7b6497), closes #5128
Features
- core: allow reusing single
raw fragment in multiple keys (fc967e2), closes #5129
6.0.3 (2024-01-13)
Bug Fixes
- core: allow raw fragments as keys with multiple conditions (d0d5de8), closes #5112
- core: fix leaking raw fragments cache (9638410)
- core: respect raw fragments in
orderBy and populateOrderBy (7bf986c), closes #5110
- core: support raw fragments in order by with pagination (67ee6f5), closes #5110
- core: do not map array types as
Loaded when partially loaded (75d035d), closes #5123
- core: provide mapped custom types into constructor with
forceEntityConstructor (b293789), closes #5118
Features
- core: export
AutoPath and UnboxArray types (000c50c), closes #5124
- core: map double and decimal properties to
number or string based on the runtime type (312f293), closes #5120
6.0.2 (2024-01-09)
Bug Fixes
- core: allow calling
em.remove with not managed entity (88e055e), closes #5103
- core: allow calling
load() on references and collections of not managed entities (3b94bf9), closes #5082
- core: respect
logging options in em.count (481d02e), closes #5085
- core: support
$some/$none/$every on nested relations (2b3bd4d), closes #5099
- reflection: fix processing of
Opt and Hidden types when used in intersection (2bd612e)
Features
- core: add
wrap(entity).isManaged() (5931649)
- entity-generator: allow customizing entity name based on schema name (1e5afb8), closes #5084
6.0.1 (2024-01-08)
Bug Fixes
- core: adjust peer dependencies versions
6.0.0 (2024-01-08)
https://mikro-orm.io/blog/mikro-orm-6-released
Bug Fixes
- core: allow using classes with private constructor with
EntitySchema (d4d5b5e)
- core: collection.loadItems() should respect wildcard populate (7f3065f), closes #4977
- core: do not load all env vars from
.env files automatically (09e60f7)
- core: ensure correct serialization of not fully populated collections (a39a850)
- core: ensure propagation and change-tracking works with
useDefineForClassFields (#4730) (83f24aa), closes #4216
- core: fix automatic calling of
ensureDatabase on init (827b1f1)
- core: fix hydration of complex FKs with joined strategy (a4f30ac)
- core: fix hydration of object embeddables via joined strategy (b3e3e55), closes #5020
- core: ignore SQL converter on object embeddables with custom types (83b989e), closes #5074
- core: improve
EntitySchema typing for repository option (37ee42e), closes #5006
- core: make
em.create strictly typed for relations too (#4752) (3535cc0), closes #4748
- core: make
Loaded type more flexible (c95e3b6), closes #3277
- core: mark
Reference.set() as private (#5017) (5aebf0b), closes #5003
- core: refactor mapping of
Date properties (#4391) (3a80369), closes #4362 #4360 #1476
- core: respect
@Index and @Unique decorators on embeddables (#4736) (c3d7717)
- core: respect global
schema option in first level cache (1833455)
- core: respect schema option for entity instances in
em.insert/Many (7eae031), closes #4424
- core: return managed entity from
em.refresh() (0bf5363)
- core: return managed entity from
em.refresh() (55815f4)
- core: rework
Collection initialization to use em.populate() (#4571) (7495142), closes #4464
- core: rework pivot table joining (#4438) (0506d36), closes #4423
- core: support embedded properties with conflicting property names (b43ef63), closes #5065
- core: use
join on conditions for populateWhere (#4025) (a03e57c), closes #3871
- entity-generator: use index expressions for complex indexes (e.g. conditional) (64a39f8), closes #4911
- knex: respect connection type in
em.getKnex() (46957ba)
- mongo: don't rename
id to _id for embeddables and entities without serialized PK (0cee82d), closes #4960
- postgres: allow postgres array operators on embedded array properties (ecf1f0c), closes #4930
- postgres: parse timestamp dates less than year 100 (e774d40), closes #5071
- respect postgresql no timestamptz precision default (#3832) (9fd7e26)
- sql: do not alias conditions for update queries with collection operators (5820d66), closes #4956
- sql: do not branch to-many joins for
$and with a single item (a737b20)
- test: fixed seed-manager.test.js on windows (#4924) (27a4504)
Code Refactoring
- remove
JavaScriptMetadataProvider (4e337cb)
- remove
Reference.load(prop: keyof T) signature (#5015) (32b48f7)
Features
- core: add
@EnsureRequestContext decorator + rename @UseRequestContext (5e088ae), closes #4009
- core: add
Collection.load() method (8aa1ad1)
- core: add
EagerProps symbol to respect eager props on type level (dfcf1f8)
- core: add
em.findAll() with optional where option (#4946) (23b0551), closes #3982
- core: add
FindOptions.exclude (#5024) (fe239cf)
- core: add
GeneratedCacheAdapter for production usage (#4167) (bd478af), closes #4164
- core: add
Hiddentype as an alternative to HiddenProps symbol (#5009) (c047bb1)
- core: add
HiddenProps symbol as type-level companion for hidden: true (7984769), closes #4093
- core: add
MikroORM.initSync() helper (#4166) (8b1a1fa), closes #4164
- core: add
Opt type as an alternative to OptionalProps symbol (#4753) (8853904)
- core: add
orm.checkConnection() helper (#4961) (b868f02), closes #4959
- core: add
ScalarRef and EntityRef types to allow explicit control (1ef7856), closes #4907
- core: add
sql.now(), sql.lower() and sql.upper() functions (#5044) (016fe63)
- core: add
sql.ref() helper (#4402) (b695811)
- core: add cursor-based pagination via
em.findByCursor() (#3975) (1e6825f)
- core: add customizable
LoggerContext with labeling support (#4233) (b985646), closes #4230
- core: add discovery hooks
onMetadata and afterDiscovered (#4799) (5f6c4f8)
- core: add entity to identity map on
em.persist() (1b09d26), closes #4905
- core: add global
serialization.forceObject option (731087d), closes #4881
- core: add optional
Type.compareValues method to allow custom comparators (732307a), closes #4870
- core: add support for indexes on JSON properties (#4735) (82c8629), closes #1230
- core: allow all
CountOptions in Collection.loadCount() (25d1851)
- core: allow auto-discovery of base classes with
EntitySchema (10cfd28)
- core: allow class references in
subscribers array (7c8f776), closes #4231
- core: allow configuring filters in
Reference.load() and Collection.load() (#5025) (06012f7), closes #4975
- core: allow defining
serialization.forceObject: true on type level (#5045) (88eb3e5)
- core: allow disabling colors via
colors ORM config option (1bcaf09), closes #5037
- core: allow extending
EntityManager (#5064) (6c363e7)
- core: allow inferring populate hint from filter via
populate: ['$infer'] (#4939) (080fdbb), closes #1309
- core: allow M:1 and 1:1 relations in virtual entities (#4932) (164a69e)
- core: allow mapping database defaults from inline embeddables (#4384) (22ad61e), closes #3887
- core: allow overriding global logging options on per-query basis (#4273) (51b6250), closes #4223
- core: allow overriding ORM config path via
--config (#3924) (2c929e0)
- core: allow passing string values for
PopulateHint enum (populateWhere) (2bd21eb)
- core: allow populating collections with references (#4776) (3da6c39), closes #1158
- core: allow setting logger context on EM level (#5023) (7e56104), closes #5022
- core: allow type-safe populate all via
populate: ['*'] (#4927) (7780f34), closes #4920
- core: allow using
Ref wrapper on scalar properties (#4358) (f9c30f1)
- core: allow using dataloader for references and collections (#4321) (8f4790f), closes #266
- core: allow using string values for
loadStrategy and flushMode (f4e4e3b)
- core: auto-join M:1 and 1:1 relations with filters (#5063) (66a6b75), closes #4975
- core: improve validation of bidirectional 1:1 relations (7eb6ee6)
- core: infer property type from default value (#4150) (38be986), closes #4060
- core: make
em.insert/Many strictly typed (require all properties) (01935e6)
- core: native
BigInt support (#4719) (31a905c)
- core: re-export the core package from all drivers (#3816) (175c059)
- core: remove static require calls (#3814) (b58f476), closes #3743
- core: require
mappedBy option for 1:m properties (716aa76)
- core: require explicitly marked raw queries via
raw() helper (#4197) (9c1b205)
- core: respect
ignoreFields on type level in wrap().toObject() (15de7a0), closes #4198
- core: respect
schema parameter in clientUrl (#4998) (9176ee0), closes #4997
- core: respect naming strategy and explicit field names on embedded properties (#4866) (6151f3b), closes #4371 #2165 #2361
- core: respect updates to M:N inverse sides and batch them (#4798) (ec65001), closes #4564
- core: return
Loaded type from Ref.load() (bc3ffa9), closes #3755
- core: return single entity from
em.populate() when called on single entity (4c4ec23)
- core: rework serialization rules to always respect populate hint (#4203) (32d7c5f), closes #4138 #4199
- core: strict partial loading (#4092) (d5d8c2d), closes #3443
- core: support atomic updates via
raw() helper (#4094) (1cd0d1e), closes #3657
- core: support mapping one column to different STI properties (#4769) (e8d391b), closes #2388 #4440
- core: throw when trying to iterate on a not initialized collection (2a3fd27), closes #3750
- core: validate abstract target in relation decorators (dddb901)
- core: validate duplicate field names (#4968) (71fead4), closes #4359
- core: validate missing relation decorator (af31b3b), closes #3807
- entity-generator: added ability to output type option in decorator (#4935) (2d1936a)
- entity-generator: allow generating scalar properties for FKs (#4892) (abad6ca), closes #4898
- entity-generator: allow local and global configuration of all options (#4965) (2876b8a)
- entity-generator: allow overriding generated entity file name (4ebc8e3), closes #5026
- entity-generator: detect more ManyToMany relations (#4974) (d0e3ac9)
- entity-generator: generate
OptionalProps and other symbols for EntitySchema (00f0a34)
- mysql: support
order by nulls first/last (#5021) (df75b24), closes #5004
- postgres: add support for native enums (#4296) (8515380), closes #2764
- postgres: add support for weighted tsvectors and a custom regconfig (#3805) (a0e2c7f), closes #3317
- query-builder: add support for lateral sub-query joins (99f87c4), closes #624
- query-builder: allow joining sub-queries (#4747) (613332c), closes #4429 #4549
- query-builder: respect discriminator column when joining STI relation (57b7094), closes #4351
- query-builder: support virtual entities (27f0c83), closes #5069
- schema: add options to
schema.ensureDatabase() method to create/clear (6a12fe1)
- sql: add native support for generated columns (#4884) (a928291)
- sql: print number of affected rows for insert and update queries (36336d9)
- sql: rework joined strategy to support the default
populateWhere: 'all' (#4957) (e5dbc24)
- sql: support
$some, $none and $every subquery operators (#4917) (50d2265), closes #2916
- sql: use joined strategy as default for SQL drivers (#4958) (90ec766)
- sql: use returning statements for reloading version fields on update (0a3abd7)
Performance Improvements
- core: cache if entity has event listeners (cfa8d52)
- core: optimize handling of FK value propagation (f3d0ec5)
- core: speed up detection of constructor/toJSON parameters during discovery (a1288de)
BREAKING CHANGES
Please see the upgrading guide.
Full Changelog: https://github.com/mikro-orm/mikro-orm/compare/v5.9.7...v6.0.0
v5
5.9.8 (2024-02-04)
Bug Fixes
- core: do not mutate data provided to
em.upsert/Many (5acb4eb), closes #5136
- core: ensure
em.insertMany returns array of PKs for a single item too (#5180) (b9a55e5), closes #5179
- core: process upsert data to allow using entity instances in place of relations (42e3c5e), closes #5165
- mongo: ensure
assign on object properties won't ignore changes (bd22d7c), closes #5158
- postgres: parse timestamp dates less than year 1000 (#5071) (63eb5c5)
5.9.7 (2023-12-30)
Bug Fixes
- core: check for root entity properties in
em.canPopulate() when using STI (b8fcf45), closes #5043
- core: fix eager loading detection with multiple populate hints for one property (da1daf5), closes #5057
- core: support pivot entities with autoincrement PK (e250634), closes #4988
- postgres: respect column length in down migrations (222e2b8), closes #5048
5.9.6 (2023-12-21)
Bug Fixes
- core: fix
assign on collections of unloaded entities (b60e4ee)
- core: fix extra updates with select-in strategy and composite FKs (c848f8c)
5.9.5 (2023-12-15)
Bug Fixes
- core: ensure eager loading on deeper levels work with joined strategy (cc5f476)
- core: fix extra updates for composite FKs that share a column (78772fb)
- core: fix infinite loop with
populate: true and refresh: true (#5001) (9f63378)
- core: fix returning statement hydration after
em.upsert (a7e9a82), closes #4945
- core: respect context in virtual entity expression callback (84d42a7)
- postgres: allow using array operators (e.g.
@>) with object arrays (6a5a1ef), closes #4973
- schema: improve json default diffing for down migrations (5bc19ba)
- sql: deduplicate keys in batch update queries (7de7a48)
5.9.4 (2023-11-17)
Bug Fixes
- cli: support
mikro-orm-esm on windows (c491af9)
- core: fix auto-refresh detection in
em.find for inlined embedded properties (759b7b8), closes #4904
- core: support composite PKs in
em.upsertMany() (85c38d4), closes #4923
- mysql: improve diffing of defaults for JSON columns (d92a440), closes #4926
- schema: do not inherit schema for FKs if not a wildcard entity (cc7fed9), closes #4918
- schema: respect explicit schema in FKs to STI entities (cc19ebb), closes #4933
- schema: respect up migration when detecting column renaming in down migration (d5af5bd), closes #4919
5.9.3 (2023-11-06)
Bug Fixes
- core: only check the same entity type when detecting early update/delete (fef7a1b), closes #4895
- core: return
DriverException from em.upsertMany() (1ebfbdd), closes #4897
- core: fix populating relations with cycles via select-in strategy (d0b35da), closes #4899
5.9.2 (2023-11-02)
Bug Fixes
- core: fix partial loading of embedded properties with joined strategy (f887e77)
- core: ignore limit, offset and order in
em.count on virtual entity (03a7b86)
- mongo: fix support for
ignoreUndefinedInQuery (cef26c5), closes #4891
5.9.1 (2023-10-31)
Bug Fixes
- core: propagate to owning side of 1:1 relation even if not initialized (9b2c9fe), closes #4879
- postgres: fix hydrating of serial properties via returning statement (620309c)
5.9.0 (2023-10-24)
Bug Fixes
- core: apply
convertToJSValueSQL on composite FKs too (41425cb), closes #4843
- core: clean up removed entities from relations in identity map (1e3bb0e), closes #4863
- core: infer property type from
columnType for non-inferrable types (e.g. unions with null) (6bc116a), closes #4833
- core: remove some computed properties from metadata cache (eb138ad)
- core: use write connection for fetching changes after upsert/upsertMany (#4872) (6b444ed), closes #4868
- query-builder: do not alias formula expressions used in
qb.groupBy() (e27e4b9), closes #2929
- query-builder: respect
preferReadReplicas in QueryBuilder (22e140e), closes #4847
- serialization: run custom serializer on getters (#4860) (e76836e), closes #4859
Features
5.8.10 (2023-10-18)
Bug Fixes
- knex: fix populating M:N from inverse side with joined strategy (9f82e95)
- reflection: ensure complete stripping of relative paths with multiple leading slashes (#4844) (8a635c7)
5.8.9 (2023-10-15)
Bug Fixes
- core: ignore SQL convertor methods on object embeddables (92e1d6f), closes #4824
- core: respect database name in
clientUrl of read replicas (015d4f4), closes #4813
- query-builder: merge raw join results in
qb.execute() (#4825) (5a28e9b), closes #4816 #4741
- schema: skip changes of enum items on enum arrays (9accdf6), closes #476
5.8.8 (2023-10-11)
Bug Fixes
- core: do not rehydrate values provided to constructor (8ff3f65), closes #4790
- core: hydrate relations with
mapToPk as scalars to support custom types (4118076), closes #4803
- postgres: escape array literal values containing backslash (#4797) (20179ec), closes #4796
Performance Improvements
- core: fix duplicate processing of collection items when flushing (a8a1021), closes #4807
5.8.7 (2023-10-05)
Bug Fixes
- core: ensure virtual relation properties have no effect on commit order (606d633), closes #4781
- core: fix conditions in
em.upsertMany with composite keys (2f58556), closes #4786
- core: fix extra updates when nullable embedded properties contain FK (77ffa4f), closes #4788
- core: improve handling of nullable embedded properties (eae7e38), closes #4787
- schema: respect length of default value of datetime columns (cbc0c50), closes #4782
5.8.6 (2023-10-02)
Bug Fixes
- core: alias joins on non persistent properties (d70d323), closes #4773
- core: respect
disableContextResolution option when forking (5964e52), closes #4717 #3338
- migrations: allow running migrations outside of main transaction (e0dfb0c), closes #4775
5.8.5 (2023-09-30)
Bug Fixes
- core: allow joining a formula property (1200e5b), closes #4759
- core: map virtual properties that shadow a regular property from joined results (d0b3698), closes #3820
- core: pin all internal dependencies (f4868ed), closes #4764
- core: support overlapping composite FKs with different nullability (208fbaa), closes #4478
- mongo: fix querying object embedded JSON properties (b38a327), closes #4755
- reflection: detect JSON properties defined with
Record or Dictionary types (62740d1), closes #4755
5.8.4 (2023-09-27)
Bug Fixes
- core: fix recomputing of changesets when entity has unique properties (d03afad), closes #4749
- query-builder: fix mapping of complex joined results with cycles (a9846dd), closes #4741
Features
- core: add
EntityRepository.getEntityName() method (#4745) (47bfedd)
- core: allow setting default
schema on EntityManager (#4717) (f7c1ef2)
- core: deprecate
UseRequestContext decorator (#4744) (280733f)
5.8.3 (2023-09-24)
Bug Fixes
- core: do not skip
cjs/mjs/cts/mts extensions during folder-based discovery (ce574a4), closes #4727
- core: ensure no duplicates exist in checks/indexes/hooks (fb523c8), closes #4733
- core: fix updating complex composite key entities via UoW (#4739) (898dcda), closes #4720
- knex: allow using knex query builder as virtual entity expression (#4740) (427cc88), closes #4628
- knex: hydrate nullable relations with joined strategy (8ddaa93), closes #4675
- mongo-migrations: fix logging of executed migrations (8ae7eeb), closes #4698
5.8.2 (2023-09-20)
Bug Fixes
- core: fix query processing when PK is falsy (#4713) (3624cb7)
- mongo-migrations: fix logging of executed migrations (2d9fc86), closes #4698
- query-builder: fix aliasing of joined embedded properties (24c4ece), closes #4711
Features
- core: allow to use
.ts files as configuration without ts-node (#4702) (bda7eca), closes #4701
- entity-generator: generate
PrimaryKeyProp and PrimaryKeyType symbols (605446a)
5.8.1 (2023-09-12)
Bug Fixes
- core: ensure entity is not in persist stack after
em.insert/Many() is called (94eed5e), closes #4692
- core: ensure merging of data to already loaded entities won't fail in some cases (f6e8204), closes #4688
- core: fix merging of collections loaded via joined strategy (b4a0260), closes #4694
- core: try to fix merging of large collections loaded via joined strategy (faae84e), closes #4694
5.8.0 (2023-09-10)
https://mikro-orm.io/blog/mikro-orm-5-8-released
Bug Fixes
- core: default baseUrl value to '.' when registering ts-node (#4680) (cc0fc5f), closes #4679
- core: ensure partial loading respects advanced mapped type methods (72554fd), closes #4622
- core: fix assigning collection items with
updateNestedEntities: false (e1bfd20)
- core: fix metadata cache for
@Check() with callback signature (44d973e), closes #4505
- core: fix removing entity that has an inverse relation with M:1
owner property (fbed4a6), closes #4578
- core: ignore null values of unknown properties in
assign() (a600f55), closes #4566
- core: map property names to column names in
qb.onConflict() (e38d126), closes #4483
- core: remove old items from 1:m collections via
set() even if not initialized (b03e165)
- core: respect explicit schema name of pivot tables (af74491), closes #4516
- core: respect filters with joined loading strategy (#4683) (847c35a), closes #704 #2440
- core: support calling
em.findAndCount() on virtual entities with orderBy (7f328ac), closes #4628
- core: support calling
em.insertMany() with empty array (2f65bc8), closes #4640
- core: use join on conditions for
populateWhere (#4682) (99177cc), closes #3871
- entity-generator: respect
precision and scale in numeric column type (3a52c39)
- mysql: fix extra updates on entities with non-primary autoincrement property (5d6ebe3), closes #4577
- query-builder: apply join condition to the target entity in M:N relations (c78d812), closes #4644
- query-builder: make
QBFilterQuery type more strict (755ef67)
- schema: respect
columnType on enum properties (#4601) (0eae590)
Features
- cli: add
--drop-db flag to migration:fresh and schema:fresh (cf1db80), closes #4569
- core: add
clear option to em.transactional() (01d1ad7)
- core: add
Collection.isEmpty() method (#4599) (2d8d506)
- core: add
Collection.slice() method (#4608) (7c99c37)
- core: add
Collection helpers map/filter/reduce/exists/findFirst/indexBy (3ba33ac), closes #4592
- core: allow disabling duplicate entities discovery validation (#4618) (3ff0dda)
- core: allow enabling result cache globally (5876c99), closes #4656
- core: allow fine-grained control over
em.upsert() (#4669) (ab0ddee), closes #4325 #4602
- core: allow global config option for
disableIdentityMap (ef32b14), closes #4653
- core: respect
batchSize in em.upsertMany() (4a21c33), closes #4421
- entity-generator: allow skipping some tables or columns (e603108), closes #4584
- migrations: add
Migration.getEntityManager() helper (79af75c), closes #4605
- mongo: support indexes on embedded properties (040896e), closes #2129
- sql: add
readOnly option to em.begin() and em.transactional() (86bb7d4)
- sql: allow specifying query comments (06d4d20)
5.7.14 (2023-07-27)
Bug Fixes
- core: ensure JSON arrays are correctly handled (5327bcc), closes #4555
- core: inferring JSON type based on
columnType when mapping to array (96d87ba), closes #4548
- entity-generator: use ref instead of wrappedReference (#4559) (be02aa4)
- mongo: do not create collections for embeddable entities (0759df0), closes #4495
- seeder: allow run method to return without promise (#4541) (8012507)
5.7.13 (2023-07-16)
Bug Fixes
- core: deprecate
wrappedReference on m:1 decorator options (d7f362e)
- core: do not fail when detecting mapped type for enum columns (b94048b), closes #2323
- core: fix handling shared columns in composite foreign keys (fbb6958)
- core: fix multiple
? in fulltext fields updates (9c9915e), closes #4484
- core: fix updating composite key entities via flush (733cb80), closes #4533
- core: respect
persist: false on relations (a127fff), closes #4504
- migrations: support reverting migrations that had extenion in the database (72df9ad), closes #4528
- mongo: drop migrations table when requested (278ba3a), closes #4513
- postgres: fix hydration of 1:1 properties when entity has version fields (474eb73), closes #4497
- sqlite: allow using
clientUrl without a host (#4447) (9a01bbd)
- sqlite: fix processing queries with large parameters (48ee8c2), closes #4526
- sql: schema not inherited in query with relations (#4477) (b680477), closes #4472
5.7.12 (2023-06-10)
Bug Fixes
- core: allow async filter callbacks in
em.addFilter() on type level (308c45b)
- core: fallback to direct property access (320c52f), closes #4434 #4216
- core: fix extra updates when
forceEntityConstructor enabled (41874eb), closes #4426
- core: fix returning clause for upsert with embeddables (#4427) (b9682f0)
- core: respect
undefined when assigning to object properties (217ff8f), closes #4428
- core: respect falsy values in
em.upsert (ef22b21), closes #4420
- mongo: allow saving self-references inside M:N properties in one flush (c1b5fc4), closes #4431
Features
5.7.11 (2023-06-01)
Bug Fixes
- cli: expose missing
migration:check command (#4388) (79e128e)
- core: fix change tracking of optional properties with
forceUndefined (9303c3f), closes #4412
- core: fix populating relations in parallel via
Promise.all (#4415) (f4127a7), closes #4213 #4343
5.7.10 (2023-05-23)
Bug Fixes
- core: exclude collections from
returning clause from em.upsert (e342449), closes #4382
- core: re-export
Reference class as Ref (50eea37), closes #4161
- core: respect
skipNull when serializing object properties/embeddables (f27ee9a), closes #4383
Features
- core: add
meta to EventArgs to the upsert events (ed431ea)
Performance Improvements
- core: set
Collection._property early for managed entities (23ca682), closes #4376
5.7.9 (2023-05-22)
Bug Fixes
- core: fix mapping of results from partial loading (541c449), closes #4377
Performance Improvements
- core: don't double clone when merging data to exiting entity (c175652), closes #4376
5.7.8 (2023-05-21)
Bug Fixes
- core: ensure
em.upsert returns initialized entity (#4370) (bad0b37), closes #4242
- core: ensure correct number of results is logged in SQL drivers (e3cd184)
- core: ensure strict type-checking of enum queries (8f8464a)
- query-builder:
qb.clone() shouldn't ignore groupBy and having clauses (7127ff6)
Features
- query-builder: add
qb.returning() (b5ab66b)
- query-builder: allow partial loading via
qb.(left/inner)JoinAndSelect() (22c8c84), closes #4364
5.7.7 (2023-05-14)
Bug Fixes
- core: deprecate
@Subscriber() decorator (033b71d)
- core: revert the
const enums as they break projects with isolatedModules (8b23674), closes #4350
- knex: remove constraints from knex's peer dependencies (ce81071)
- query-builder: do not enable query pagination when explicit
groupBy is set (921251a), closes #4353
Features
- core: add
options argument to filter callback (c57ee5e), closes #4352
- query-builder: validate unknown alias when explicitly joining (8d4a83a), closes #4353
5.7.6 (2023-05-13)
Bug Fixes
- core: allow
em.populate() on lazy formula properties (5c6bb13)
- core: ensure database values are used in the identity map keys (46b5e3a), closes #4335
- core: fix re-populating relations with
refresh: true (74b6a98), closes #4339
Features
- core: add
wrap(entity).populate([...]) shortcut (6b519c4)
- core: log number of results (261b3d9)
Performance Improvements
- core: define some enums as const enums, so they get inlined (3cb43ba)
5.7.5 (2023-05-09)
Bug Fixes
- core: deprecate
wrappedReference and IdentifiedReference (ab79832)
- core: detect early deletes for compound unique constraints (f9530e4), closes #4305
- core: fix extra updates caused by bigint type (2acd25e), closes #4249
- core: fix extra updates caused by property initializers when
forceEntityConstructor is enabled (7ee883d), closes #4323
- core: respect schema name when checking duplicate table names (5b89b00), closes #4332
- mongo: sorting with UnderscoreNamingStrategy (#4314) (a5b0f94), closes #4313
- postgres: improve enum/check constraint inspection in schema diffing (6c44b42), closes #4312
5.7.4 (2023-05-01)
Bug Fixes
- core: expand PK conditions inside top level operators (305ce5d), closes #4222
- core: fix extra updates when caching inlined embedded entities (3dc3b32), closes #4295
- core: fix object merging in
assign helper when current value is scalar (c012f95), closes #4290
- core: only consider valid query as tuple comparison (7212a53), closes #4220
- migrations: respect custom migration name in migration class names (#4294) (c402a99)
5.7.3 (2023-04-28)
Bug Fixes
- core: merge returned values to the initial entity snapshot (e123076), closes #4284
- postgres: do not convert
date column type to Date object automatically (a7d1d09), closes #4194 #4276
Features
- core: add
beforeUpsert and afterUpsert events (db9ff09), closes #4282
- core: allow creating DELETE changesets via
uow.computeChangeSet() (61479b6), closes #4280
- core: allow disabling validation for duplicate
tableName (dfb87bf)
5.7.2 (2023-04-25)
Bug Fixes
- cli: await the yargs.parse call in esm.ts (#4272) (dcdf70a)
- core: don't skip updates from propagation triggered via
em.create() (30778c3), closes #4209
- core: quote JSON property paths if they contain special characters (a94bbce), closes #4264
- core: respect
forceUndefined in the original entity data (d2d9cc0), closes #4262 #4266
- core: respect
serialize() skipNull option inside embeddables (4cf7669), closes #4263
- migrations: allow generating named initial migration (01d6a39), closes #4271
5.7.1 (2023-04-25)
Bug Fixes
5.7.0 (2023-04-23)
Bug Fixes
- core: clean up bidirectional references after removal of entity (bfd3840), closes #4234
- core: detect
JsonType based on columnType (#4252) (2e01622), closes #4229
- core: do not try to propagate changes to
mapToPk relations (7028890), closes #4254
- core: fix mapping of joined relations with buffer PKs (8e9e7ee), closes #4219
- core: merge env vars with explicit configuration recursively (392a623), closes #4235
- core: prevent tuple type properties from being converted to array when serializing entities (#4205) (04ad72e)
- core: propagate changes from extra updates back to the original changeset (77f5c14), closes #4245
- core: rework JSON value processing (#4194) (5594c46), closes #4193
- mariadb: use
json_extract when querying JSON fields (ca96acc)
- query-builder: fix pagination when PK uses
BigIntType (b789031), closes #4227
- query-builder: support
onConflict().ignore() without parameters (3a3b0bd), closes #4224
- schema: fix comparing default value of JSON properties (41277a1), closes #4212
Features
- core: allow disabling transactions (#4260) (8e8bc38), closes #3747 #3992
- core: deprecate
persist/flush/remove methods from EntityRepository (#4259) (eba4563), closes #3989
- core: validate repository type in
repo.populate() and repo.assign() (301bdf8), closes #3989
- core: validate unique
tableName (0693029), closes #4149
- migrations: add support for custom migration names (#4250) (fb2879e)
- mongo: allow setting weights on index (299b188), closes #4172
Performance Improvements
- core: fix eager loading of multiple properties causing cycles (ecbecfc), closes #4213
5.6.16 (2023-04-04)
Bug Fixes
- core: don't override discovery options when
alwaysAnalyseProperties is used (f4acc91), closes #4181
- core: ensure correct FK as PK identity map key (475e2a3)
- core: fix hydration of 1:1 FK as PK property via joined strategy (75653f0), closes #4160
- core: hydrate collection items when merging data in
factory.create (493d653), closes #4173
- core: normalize zero in bigint type to string (78a8e48), closes #4159
- core: use JsonType automatically when
type: 'jsonb' (43cb6d7)
- migrations: do not interact with the database when snapshot exists (48df462)
- mysql: fix mapping of PK in
upsertMany (0f4cf85), closes #4153
Features
- migrator: allow disabling logging via
migrations.silent (#4182) (4b778bf), closes #4124
Performance Improvements
- core: populating many large 1:M collections (875d966), closes #4171
5.6.15 (2023-03-18)
Bug Fixes
- core: deduplicate columns in insert queries (db734d6)
- core: fix nested inlined embedded property hydration (2bbcb47), closes #4145
- core: fix snapshot of relation properties loaded via joined strategy (6015f3f), closes #4129
- core: respect explicit
unsigned option (#4126) (846a57d)
- sqlite: fix detecting multi-line
returning queries (ba1a5fc), closes #4133
5.6.14 (2023-03-12)
Bug Fixes
- core: allow comparing
{} with Object.create(null) (955895e), closes #4109
- core: assigning to reference properties inside embeddables (ede04e6), closes #4106
- core: discover pivot entities automatically when specified by reference (3ea4776)
- core: ensure
populate: true supports nested relations inside M:N (b42f0f3)
- core: extra update on a reference with 1:1 self-reference (f2fa2bd), closes #4121
- core: fix nested object merging in JSON properties (694ef28), closes #4101
- core: improve handling of complex pivot table entities (45449c4), closes #4083
- postgres: use explicit schema in table identifier when altering comments (#4123) (60d96de), closes #4108
- query-builder: ensure inner paginate query selects sub-queries used in orderBy (22b7146), closes #4104
- query-builder: fix update query with auto-join of 1:1 owner (0a053fe), closes #4122
Features
- core: allow skipping
convertToDatabaseValue during hydration (d1ce240), closes #4120
- migrations: add
params to the Migration.execute method (f280e6d), closes #4099
5.6.13 (2023-03-01)
Bug Fixes
- core: fix deep assigning of collection items with complex composite keys (95631f4), closes #4074
- core: fix diffing of JSON properties (2e9a026), closes #4078
- core: log abstract entity names during discovery (e721ad7), closes #4080
- postgres: use quoted schema+table name when dropping constraints (#4079) (ff1dfb6)
5.6.12 (2023-02-26)
Bug Fixes
- core: enforce select-in strategy for self-referencing eager relations (cc07c6b), closes #4061
- core: ensure custom types are processed in
em.upsert/upsertMany/insertMany (53a08ac), closes #4070
- core: move repository cache to the EM fork (05fabb9), closes #3074
- mongo: move $fulltext from $and to top level (#4066) (680a99c), closes #4065
- mysql: fix reloading of db defaults for complex composite PKs (8dcc1bd), closes #4062
5.6.11 (2023-02-17)
Bug Fixes
- core: do not process custom types twice in
em.upsertMany (3928e78), closes #3787
- core: fix mapping of
null in datetime columns (73e483a), closes #4057
- core: infer custom type even if there is explicit
columnType option (a901112)
- schema: fix merging of primary keys from base entity (c40e15c), closes #4051
5.6.10 (2023-02-17)
Bug Fixes
- core: convert custom types in delete queries from orphan removal (b32df88), closes #4033
- core: convert custom types when snapshotting scalar composite keys (391732e), closes #3988
- core: map returned values correctly after batch insert (a61a84f)
- core: map values from returning statement in
em.upsert (bed72fe), closes #4020
- core: use types from
discovery.getMappedType on runtime too (2f682e3), closes #4042
Performance Improvements
- core: improve result mapping and snapshotting (#4053) (8bb0268)
5.6.9 (2023-02-10)
Bug Fixes
- core: add missing
repo.upsertMany shortcut (c101d51)
- core: do not serialize JSON values twice (f06eeb0)
- core: do not snapshot missing embedded properties as
undefined (4ad4cdf)
- core: ensure json type is recognized with
type: 'jsonb' (e1f82bc), closes #3998
- core: improve handling of not managed references created via
ref()/rel() (2e814e8), closes #4027
- query-builder: respect
qb.joinAndSelect when serializing (4025869), closes #4034 #3812
Features
- core: optionally log if entity is managed or not (68e073b)
- migrations: add
cjs option for emit (#4016) (d5cfa22), closes #4005
5.6.8 (2023-01-25)
Bug Fixes
- mysql: fix reloading of database defaults for complex composite PKs (d36af00), closes #3965
- reflection: do not rehydrate metadata cache for enum items unless needed (e4761b6), closes #3955
- migrations-mongo: replace backslash in the glob to fix windows support (d904ba0), closes #3957
Features
- core: add
forceConstructor option to @Entity() decorator (c89b4af)
- core: add
hydrate option to @Property() decorator (f4ba092), closes #3936
- core: allow filtering in
Collection.loadCount() (#3958) (08ea320), closes #3527
- mongo: add missing
MongoEntityRepository.getCollection() shortcut (5e4e126), closes #3951
5.6.7 (2023-01-13)
Bug Fixes
- core: ensure propagation during hydration dont produce extra updates (88595bd), closes #3941
- core: propagate ManyToOne only to matching collections (STI) (#3940) (8ff7ed1), closes #3939
- core: respect
mapToPk during hydration with custom type FK (75d05ee), closes #3921
Features
- seeder: expose
Factory.makeEntity method that does not call em.persist() (bb8f1b0), closes #3932
5.6.6 (2023-01-10)
Bug Fixes
- core: make
FilterQuery strict again! (5427097)
- core: do not allow functions and symbols in
FilterQuery (85b1fc1), closes #3928
5.6.5 (2023-01-09)
Bug Fixes
- core: do not fail on serialization when POJO instead of embeddable instance found (c8de84b)
- core: make serialization of embedded properties support
null instead of value (3006507), closes #3906
- entity-generator: use table name instead of class name in
EntitySchema (#3916) (84d9407), closes #3915
Features
5.6.4 (2023-01-04)
Bug Fixes
- core: improve inference of driver exported
MikroORM.init() (497f274)
- core: respect transaction context in
em.execute() (832105d), closes #3896
- mongo: register serialized PK get/set pair only when explicitly requested (7004100), closes #3900
- mongo: respect field names in batch update conditions (3466c86), closes #3897
Features
5.6.3 (2022-12-28)
Bug Fixes
- core: delay snapshotting of entity state to fix differences with joined strategy (cbf62fa), closes #3876
- core: do not convert custom mapped type twice in
Reference.createFromPK (7dfff45), closes #3878
5.6.2 (2022-12-25)
Bug Fixes
- core: fix assignability of
Loaded type to naked entity (e574924), closes #3865
- core: respect
* in partial loading with joined strategy (7781f84), closes #3868
Features
- core: validate bidirectional M:N with
pivotEntity (5e793a2), closes #3860
- core: validate FK as PK is always an owning side (330c4e2), closes #3869
5.6.1 (2022-12-20)
Bug Fixes
- core: allow adding array of refs to collection (#3859) (0ce85e9)
- core: clone event manager when forking in
em.transactional (0e523b3), closes #3857
- core: do not unset non-null relations when propagating remove operation (69a7f94), closes #3854
- core: fix compiled functions when relation property uses hyphens (22350bd), closes #3813
- core: fix populating relation with composite FK as primary key (b27578f), closes #3844
- core: improve inference in
em.findX() methods (fcb1739)
- core: propagation with nullable 1:1 relation (#3851) (d77c370), closes #3850
- core: remove
readonly modifier from Populate type (7b2dfb9)
- mariadb: do not force date strings (8861354), closes #3853
- postgres: compare only simplified versions of check constraints (0fd8530), closes #3827
- postgres: ignore internal timescale schemas automatically (85d9083)
5.6.0 (2022-12-09)
Bug Fixes
- core: deprecate
type option in favour of driver exports (7180f23), closes #3743
- core: do not mark entities as populated via
em.merge() (bfa4962), closes #3812
- core: do not process mapped types twice in
em.upsert() (434d417), closes #3787
- core: ensure correct result in
ChangeSet.getPrimaryKey(true) (2e74a34), closes #3737
- core: fix query execution inside hooks sometimes hanging (d68b9bd)
- core: make
ChangeSet.getPrimaryKey() response stable (d32c956)
- core: remove
readonly from properties of FilterQuery (2a2a13d), closes #3836
- core: return
Ref & LoadedReference from ref() (c85e507), closes #3840
- core: serialize not managed relations as populated (89b4dab), closes #3788
- core: support
hidden flag on primary keys (4935505)
- embeddables: respect explicit
null only for object embeddables (6e0bedf), closes #3772
- mysql: ensure bigint columns are mapped to string (d3d50ba), closes #3739
- mysql: respect
auto_increment_increment when batch inserting (516db6d), closes #3828
- postgres: quote array literal items containing a comma (5ffa81c), closes #3810
- postgres: use
postgres as the management db name + allow override (eab1668), closes #3769
- query-builder: fix cloning QB in some cases (c3b4c20), closes #3720
- query-builder: fix querying for a composite FK when target is joined (dec4c9c), closes #3738
- query-builder: respect case-insensitive regexp flag (1a1d381), closes #3801
- query-build: fix query execution inside hooks sometimes hanging (dba6ce2)
- schema: do not cache knex instance (dc00374), closes #3713
- schema: ensure database exists before dropping schema (fd4c416), closes #3713
- ts: allow string dates in
em.create() (d0607d5)
Features
Performance Improvements
- core: never clone Platform and EntityMetadata instances (9e05104), closes #3720
5.5.3 (2022-11-10)
Bug Fixes
- core: respect filters when loading m:n relations (#3716) (86a65a7)
- postgres: fix ensuring database exists (d23dde0), closes #3713
Features
- mongo: allow passing transaction options to the mongo client (d52c747), closes #3703
Performance Improvements
- core: redefine the internal
__helper getter with a static value (77d0549)
5.5.2 (2022-11-07)
Bug Fixes
- core: prefer custom pivot entity for inference of FK names (08a7dc2), closes #3626
- knex: always skip virtual properties in returning clause (#3699) (c084dde)
5.5.1 (2022-11-05)
Bug Fixes
- core: compare original entity data when checking for unique props (53ff984), closes #3644
- core: fix
em.upsert() when entity is already in context (f590b79), closes #3667
- core: fix comparing empty arrays (be4cdf3), closes #3694
- core: fix orphan removal for collections of complex/nested composite keys (925c1d2), closes #3666
- core: fix querying for a complex composite key via inverse side (b99e7bb), closes #3669
- core: handle
$fulltext search correctly in nested queries (9a2f535), closes #3696
- core: improve detection of entity file path via stack trace (d329d32), closes #3668
- core: improve propagation of changes to 1:1 relations (389b4a2), closes #3614
- embeddables: support partial loading hints (0c33e00), closes #3673
- knex: ensure virtual properties are never part of
returning clause (35d51fe), closes #3664
- postgres: fix ensuring database exists when
postgres database does not exist (b1a867d), closes #3671
- reflection: fix reflection of embedded array types (786ba42), closes #3690
- reflection: improve detection of array properties (8f8f820), closes #3690
Features
- core: add
em.repo() shortcut (feebd7c)
- core: add
EntityOptions.repository shortcut (2cbb129)
- core: add
EntityRepository.upsert() shortcut (31d6d77)
- core: add
ref alias for wrappedReference relation property option (249a407)
- core: add
Rel<T> and Ref<T> relation types (44acefb)
- core: add context param to
Type.convertToDatabaseValue() (a933e98), closes #3567
- core: allow using second argument of
@OneToOne as options (115462d)
- core: propagate parent entity to collection item payload in
assign (6045511), closes #3654
- core: propagate parent entity to collection item payload in
create (bb9f8d9), closes #3654
- core: support composite unique keys in
em.upsert() (3cf79d6), closes #3656
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)
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)
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)
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)
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
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
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
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)
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)
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
5.2.0 (2022-06-10)
Bug Fixes
- core: allow changing PK via UoW (32ab215), closes #3184
- core: ensure correct cached value in
loadCount (4471bb8)
- query-builder: fix calling
qb.count('id', true).getCount() (a97324a), closes #3182
- query-builder: fix processing of custom types in explicitly aliased queries (db137a6), closes #3172
- schema: do not consider autoincrement columns as primary automatically (088afdb), closes #3187
- ts-morph: use module: 'node16' for reflection (024d9d9), closes #3168
- typing detection with typescript 4.7 node16 (#3163) (08322fa)
Features
- core: automatically discover target embeddables and relationships (#3190) (8624dc5)
- entity-generator: allow generating bidirectional relations (8b93400), closes #3181
- entity-generator: allow generating identified references (1fbf5ac)
- knex: allow reusing existing knex client via
driverOptions (c169eda), closes #3167
- schema: add logging to schema comparator (f96eaaf)
5.1.5 (2022-05-29)
Bug Fixes
- cli: disable TS mode when we fail to register ts-node (457d9d3), closes #3152
- core: assign new embeddable entity only when it is null or undefined (#3135) (4f870fb)
- core: support TypeScript 4.7 (06b6e4e)
- query-builder: fix aliasing of relations with composite PK (095e241), closes #3053
Performance Improvements
- query-builder: use distinct counts only when joining to-many relations (eebe34d), closes #3044
5.1.4 (2022-05-19)
Bug Fixes
- core: allow asterisk in
FindOptions.fields on TS level (43e1d0b), closes #3127
- core: fix aliasing of formula properties in complex conditions (#3130) (071846e)
- core: improve type of
em.getContext() (158f077), closes #3120
- core: improve validation of wrong entity references (#3085) (f5de135)
- core: wrap relations in
Reference wrapper when assigning entity instance (97f1f59), closes #3092
- mongo: support queries with mongo specific operators on embeddables (2fb9002)
- postgres: do not try to create schema for migrations when it exists (d6af811), closes #3106
- postgres: fix resolving knex when other version is explicitly installed (41f5665), closes #3129
- postgres: ignore schemas prefixed with
crdb_ too (049fea3), closes #3021
- schema: always ignore PostGIS schemas when diffing (#3096) (626e3db)
- ts-morph: do not mark properties as enums automatically based on type (c3923df), closes #3099
Features
- core: add
strict option to em.findOneOrFail() (#3088) (d38242a)
- postgres: allow ignoring specified schemas (3f1d2da)
5.1.3 (2022-04-27)
Bug Fixes
- core: allow replacing target entity in relations with
assign (90ec83f), closes #3026
- core: do not inline query for JSON properties that match PK names (e6005d8), closes #3054
- core: fix serialization when using partial loading for nested relations (00be9f1), closes #3011
- core: hydrate nullable embedded properties as
null (e8490f6), closes #3063
- core: respect mapToPk when expanding properties (#3031) (757801e)
- core: try to fix FK order automatically for custom pivot entities (cc9e427), closes #3040
- mongo: fix ensuring indexes with polymorphic embeddables (aa5e4d2), closes #3013
- postgres: allow using special characters in string arrays (366da5f), closes #3037
- postgres: ensure schema exists before creating migrations table (f211813), closes #3039
- schema: fix diffing of indexes with too long inferred name (01ba9ed), closes #2932
- schema: remove FKs first when trying to
dropSchema without disabled FKs (b1b5f55), closes #3004
- seeder: explicitly flush forks when calling
Seeder.call() (c8ece7c), closes #2998
- seeder: fix type of Factory methods (#3064) (06e88e7)
- sqlite: fix reflection of tables with FKs (389bc0d), closes #2959
- sqlite: upgrade knex to v2 + switch back to sqlite3 (f3e4b9d), closes #3046
Features
- core: validate decorator parameters are used properly (cb3e1dd), closes #3040
- seeder: created shared context when calling other seeders (6fa04ae), closes #3022
Performance Improvements
- core: do not use contextual EM where we know we are in a fork already (ba16532)
5.1.2 (2022-04-10)
Bug Fixes
- core: allow converting custom types via
em.nativeInsert() (#2979) (8d76852)
- core: do not clean up UoW before each "flush step" (3ae732d), closes #2934
- core: do not quote knex.raw() instances returned from custom types (8a4c836), closes #1841
- core: fix eager loading of nested embeddable m:1 properties (4867db9), closes #2975
- core: fix eager loading when multiple relations target same entity (21922ce), closes #2990
- core: fix mapping of inserted PKs with custom field names from batch insert (080d8e0), closes #2977
- core: never reassign the same entity via
em.assign() (cdfbabd), closes #2974
- core: propagate entity removal in
em.transactional() to upper context (6e5166b), closes #2973
- core: respect
connectionType in populate queries (fe40a9f), closes #2994
- core: support
PopulateHint.INFER with pagination and joined strategy (56f8737), closes #2985
- core: use correct path for relations inside embeddables with populate: true (4735dba), closes #2948
- postgres: do not ignore custom PK constraint names (#2931) (24bf10e)
- postgres: drop enum constraints only when the column was an enum (76fef39)
- postgres: ensure correct column order in compound index/uniques (321be79), closes #2932
- postgres: fix pagination with order by bool column (d5476cd), closes #2910
- postgres: fix schema diffing on enums with case-sensitive names (050875b), closes #2938 #2932
- schema: do not create FK index for 1:1 properties (they are unique already) (473795c), closes #2942
Features
- mariadb: implement check constraint support + fix json column diffing (b513b16), closes #2151
- schema: support mysql 8 (#2961) (acc960e)
5.1.1 (2022-03-20)
Bug Fixes
- core: fix custom pivot table entities for unidirectional relations (01bdbf6)
- knex:
order by with a formula field should not include as for sub-queries (#2929) (74751fb)
- postgres: allow explicit schema name in
prop.pivotTable (1860ff5), closes #2919
- postgres: fix pagination with order by UUID PK (042626c), closes #2910
- postgres: respect known schema when loading wild card entity relations (61d1e85), closes #2909
- schema: respect
disableForeignKeys in schema generator (f1b8e46), closes #2912
Features
- core: validate
em.begin was called when using em.commit/rollback (67fa076), closes #2918
5.1.0 (2022-03-13)
Bug Fixes
- core: do not alias JSON conditions on update/delete queries (5c0674e), closes #2839
- core: ensure all entities from inner context are merged to the upper one (7b3a6b4), closes #2882
- core: fix object key utilities for null prototype objects (#2847) (b2cf01e), closes #2846
- core: fix ordering by complex composite PKs (dde11d3), closes #2886
- core: fix strict type for
orderBy when entity has length property (ef45871), closes #2829
- core: type global
entityRepository option weakly (3faf8bc)
- knex:
order by with a formula field should not include as (#2848) (09e8bfa)
- knex: fully qualify sub-query order-by fields (#2835) (f74dc73)
- mysql: mark FK columns as unsigned for mixed composite PKs (67806cb), closes #2844
- postgres: respect schema name in migration storage (fbf9bfa), closes #2828
Features
- core: allow better control over connection type when using read-replicas (#2896) (e40ae2d)
- core: allow specifying custom pivot table entity (#2901) (8237d16)
- core: allow using hooks for interface entities (#2895) (aee99b1)
- core: enable
QueryFlag.PAGINATE automatically for em.find() (ccb4223), closes #2867
- core: map check constraint failures to specific error type (ebcbdff), closes #2836
5.0.5 (2022-02-27)
Bug Fixes
- core: fix auto-joining multiple 1:1 properties (0566e74), closes #2821
- core: respect
orphanRemoval in 1:1 relations (#2816) (55ff07b)
- knex: respect explicit transaction in
em.count() (#2818) (2d26a63)
- migrations: ensure executedAt is a
Date when listing executed migrations (c8753ee), closes #2817
- query-builder: use paginate flag automatically based on to-many joins (db9963f), closes #2823
5.0.4 (2022-02-22)
Bug Fixes
- core: always create new entities as initialized (bbb30c5)
- core: fix mapping default values of relation properties (bc57ed0)
- core: fix propagation of FK as PK with not flushed entity (25be857), closes #2810
- core: fix unsetting identity of orphans (1:1 with orphan removal) (91e7315), closes #2806
- core: respect schema from config when adding new entities to context (7a6b6e2)
- core: respect load strategy specified in property definition (1a6b4b2), closes #2803
- entity-generator: fix property names for columns with dashes (#2813) (c920d5f)
- schema: escape table/column comments (fff1581), closes #2805
5.0.3 (2022-02-20)
Bug Fixes
- core: do not trigger global context validation from repositories (f651865), closes #2778
- core: fix processing of
onUpdate properties (9cf454e), closes #2781
- core: fix processing of multiple
onUpdate properties on one entity (4f0e4cc), closes #2784
- core: hydrate not-null embeddable prop even with all null values (09aee05), closes #2774
- core: register entity to identity map as early as possible (d8f3613), closes #2777
- core: respect
onDelete: cascade when propagating removal (f1e8578), closes #2703
- core: revert to
require() when getting ORM version to fix webpack support (6cfb526), closes #2799
- migrations: generate snapshot too when using
--initial (4857be7), closes #2800
- postgres: consider int8 as numeric when inferring autoincrement value (64bc99d), closes #2791
- sqlite: respect
autoincrement: false in schema diffing (b39b6ad), closes #2800
- typing: fix populate hints on collections where both type args are provided (e39ef5b), closes #2771
Features
- add better-sqlite driver (#2792) (1b39d66)
- core: add
connect config option (8aaad33)
- core: add
SchemaGenerator.clearDatabase() (ecad9c6), closes #2220
- core: add populate option to
Reference.load and Collection.loadItems (1527c1a), closes #2796
5.0.2 (2022-02-16)
Bug Fixes
- core: allow passing entity instance in
repo.nativeInsert() (791c009)
- core: do not ignore schema name from config in
em.getReference() (58680fc)
- core: do not ignore schema name in batch queries (b47393e)
- core: do not ignore schema name in collection updates (d688dc1)
- core: do not ignore value from database even if we only have a getter (35103b3), closes #2760
- core: respect global schema (b569686)
- postgres: do not ignore custom PK constraint names (3201ef7), closes #2762
- seeder: declare missing dependency on globby (0599032)
- typing: remove overloads for
em.nativeInsert() (e21d470)
5.0.1 (2022-02-13)
Bug Fixes
- core: allow cloning QB with raw conditions (04d9d88), closes #2748
- core: allow using 0 as PK (a2e423c), closes #2729
- core: do not propagate removal to FK as PK (a0a19c2), closes #2723
- core: fix support for complex composite (nested) PKs (a7fc7a1), closes #2647
- core: ignore ORM packages where we failed to extract version (b1627c5), closes #2732
- core: respect
null in Loaded type (72385b3), closes #2750
- core: return entity type from
em.create() instead of New<T> (8ff277d), closes #2727
- core: support special characters in
clientUrl (43e28b8), closes #2730
- core: use
createRequire instead of dynamic import for JSON files (f567d2d), closes #2738
- embeddables: fix loading inline embeddables with joined strategy (adaa5c6), closes #2717
- esm: fix getting ORM version on windows with ESM (eb3a1be)
- mongo: fix caching populated results in mongo (42ea5be), closes #2754
- query-builder: respect explicit entity schema (717aa5e), closes #2740
- schema: fix explicit schema name support (#2752) (68631ea)
- seeder: fix Factory type for entity with constructor params (#2745) (8b7b977)
- typing: exclude symbols and functions from
FilterQuery (1d24eb8), closes #2742
Features
- core: add
getContext parameter to @UseRequestContext() (9516b48), closes #2721
- query-builder: allow autocomplete on
qb.orderBy() (fdf03c3), closes #2747
- schema: ensure database when calling
refreshDatabase() (7ce12d6)
- seeder: refactor seeder to support running compiled files (#2751) (8d9c4c0), closes #2728
5.0.0 (2022-02-06)
https://medium.com/@b4nan/mikro-orm-5-stricter-safer-smarter-b8412e84cca4
Bug Fixes
- assign: do not convert FK to entity when assigning to
mapToPK property (b14c8fb), closes #2337
- cli: validate configuration in CLI cache commands (#2146) (544583b), closes #2145
- core: allow calling
em.create() with reference wrapper (c069960)
- core: allow empty strings in postgres arrays (#2680) (5a33722)
- core: allow using MongoNamingStrategy with SQL drivers (c38c66c)
- core: fix pivot tables for wild card schema entities (623dc91)
- core: fix populating entities with wildcard schema (98d0bfb)
- core: fix support for nested composite PKs (14dcff8)
- core: handle
file:// urls in normalizePath (#2697) (127b0ae)
- core: respect request context when creating QB (a2b7b84)
- core: respect specified schema when populating (select-in) (#2676) (21a1be0)
- core: allow non-standard property names (hyphens, spaces, ...) (cc68230), closes #1958
- core: allow propagation to multiple matching inverse sides (cf7d538), closes #2371
- core: consider objects without prototype as POJO (b49807f), closes #2274
- core: declare peer dependencies on driver packages (1873e8c), closes #2110
- core: detect ts-jest usage (94acc18)
- core: do not check stack trace when detecting ts-node (06cca85)
- core: do not override existing values via
prop.onCreate (fb67ea6)
- core: do not propagate
mapToPk properties (b93c59e)
- core: fix conversion of custom type PKs in some cases (28e83ef), closes #1263
- core: fix nested query with fk as pk (#2650) (cc54ff9), closes #2648
- core: fix ordering by pivot table with explicit schema name (eb1f9bb), closes #2621
- core: fix propagation of locking option with select-in population (f3990d0), closes #1670
- core: improve partial loading of 1:m relations (3ddde1e), closes #2651
- core: issue early delete queries for recreating unique properties (decfd10), closes #2273
- core: propagate
em.remove() to 1:m collections (c23c39c), closes #2395
- core: propagate
em.remove() to m:1 properties of 1:m relations (e6fa2f7), closes #2636
- core: reload default values after flush in mysql/sqlite (d57a6a9), closes #2581
- core: respect read replica options (#2152) (9ec668d), closes #1963
- core: rework orphan removal and cascading (#2532) (eb3ea4a)
- core: save collection snapshots recursively after flush (3f5ba2f), closes #2410 #2411
- core: schedule orphan removal on 1:1 inverse sides when relation nulled (a904fe8), closes #2273
- core: support loading lazy scalar properties via
em.populate() (c20fe88), closes #1479
- core: sync
MigrateOptions type in core with migrations package (#2259) (d4b8c2c)
- core: truly load the whole entity graph when
populate: true (3c21663), closes #1134
- core: use clean internal identity map with
disableIdentityMap (0677d74), closes #1307
- embeddables: order of discovery of embeddables should not matter (d955b29), closes #2149
- knex: quote version column (#2402) (5bbbd15), closes #2401
- migrations: clear the migrations table in
migration:fresh (63eb4e6)
- migrations: respect
baseDir and allow absolute paths for sqlite dbName (36a3ae5)
- postgres: allow type casting in nested conditions (bbd0eb4), closes #2227
- postgres: fix runtime support for native pg enum arrays (#2584) (fcdb9b0)
- postgres: limit index names to 64 characters (48c105a), closes #1915
- postgres: support comparing array columns via
$eq (6eb320e), closes #2462
- query-builder: fix mapping of formula properties (2607266)
- query-builder: respect
0 as limit (#2700) (3f284ed)
- query-builder: fix nested ordered pagination (#2351) (c5a5c6b)
- query-builder: support joining same property multiple times (b62fb05), closes #2602
- query-builder: translate field names in
qb.merge() (5aead23), closes #2177
- query-builder: validate missing
onConflict calls (30392bc), closes #1803
- schema: do not ignore entity level indexes with just expression (0ee9c4d)
- schema: improve diffing of default values for strings and dates (d4ac638), closes #2385
- seeder: fork EM in the seeder manager so we dont use global context (022a1cc)
- sql: split
$and branches when auto joining to-many relations (70c795a)
- sti: allow m:n relations between two STI entities (6c797e9), closes #2246
- ts-morph: fix validation of embedded polymorphic arrays (b6a068a)
- types: fix populate type hints for nullable properties (bc1bf76)
- validation: throw when calling
qb.update/delete() after qb.where() (96893e0), closes #2390
Features
- cli: validate CLI package is installed locally (8952149)
- cli: add
database:create command (#1778) (7e9d97d), closes #1757
- cli: allow exporting async functions from CLI config (912728d)
- cli: improve loading of CLI settings from package.json (03f9ddd), closes #545
- cli: only warn with
useTsNode: true without ts-node available (5aff134), closes #1957
- core: add
em.clearCache(key) method (1ccfad8)
- core: add
persistOnCreate option and enable it for seeder (f0fec1b)
- core: add custom table check constraint support for postgres (#2688) (89aca5f)
- core: allow defining check constraints via callback (965f740)
- core: expose
referencedColumnNames on m:1/1:1 decorators (2f5a5e1)
- core: make
em.create() respect required properties (2385f1d)
- core: validate required properties before flushing new entities (9eec3a9)
- core: validate version mismatch in ORM packages (cf70219)
- core: add
EventType.onLoad that fires after entity is fully loaded (14c2fa9)
- core: add
freshEventManager to em.fork() options (a0f3fd0), closes #1741
- core: add
populateWhere option (#2660) (16c5e91)
- core: add
QueryFlag.AUTO_JOIN_ONE_TO_ONE_OWNER (be9d9e1), closes #1660
- core: add
Reference.createFromPK() helper method (2217154)
- core: add callback parameter to
Collection.remove() (0b37654), closes #2398
- core: add index/key name to naming strategy (a842e3e)
- core: add PlainObject class that DTO's can extend to treat class as POJO (#1837) (645b27a)
- core: add support for advanced locking (0cbed9c), closes #1786
- core: add support for concurrency checks (#2437) (acd43fe)
- core: add support for custom property ordering (#2444) (40ae4d6)
- core: add support for ESM via
gen-esm-wrapper (aa71065), closes #1010
- core: add support for multiple schemas (including UoW) (#2296) (d64d100), closes #2074
- core: add support for polymorphic embeddables (#2426) (7b7c3a2), closes #1165
- core: allow configuring aliasing naming strategy (#2419) (89d63b3)
- core: allow passing arrays in
orderBy parameter (#2211) (0ec22ed), closes #2010
- core: allow providing custom
Logger instance (#2443) (c7a75e0)
- core: allow using short lived tokens in config (4499838), closes #1818
- core: automatically infer
populate hint based on fields (0097539), closes #2468
- core: conditionally support folder based discovery of ESM (8c8f0d0), closes #2631
- core: implement auto-flush mode (#2491) (f1d8bf1), closes #2359
- core: implement auto-refreshing of loaded entities (#2263) (9dce38c), closes #2292
- core: implement partial loading support for joined loading strategy (2bebb5e), closes #1707
- core: keep collection state of dirty collections after initializing (49ed651), closes #2408
- core: make
FindOptions.fields strictly typed (dot notation) (fd43099)
- core: make
populate parameter strictly typed with dot notation (3372f02)
- core: move
@UseRequestContext() decorator to core package (253216d)
- core: rework deep assigning of entities and enable it by default (#1978) (8f455ad)
- core: support column names with spaces (00b54b4), closes #1617
- core: use
AsyncLocalStorage instead of domain API (be27bf7)
- core: validate populate hint on runtime for joined strategy too (94877e3), closes #2527
- core: validate usage of global context (#2381) (f0cbcc2)
- embeddables: allow using m:1 properties inside embeddables (#1948) (ffca73e)
- embeddables: support
onCreate and onUpdate (288899d), closes #2283 #2391
- entity-generator: add support for generating M:N properties (c0628c5)
- entity-generator: add enum generation support (#2608) (1e0b411)
- entity-generator: allow specifying schema (beb2993), closes #1301
- filters: add
em parameter to the filter callback parameters (6858986), closes #2214
- knex: export also global
knex function (383bc24)
- migrations: allow providing custom
MigrationGenerator (3cc366b), closes #1913
- migrations: allow using migrations with ES modules (072f23f), closes #2631
- migrations: ensure the database exists when using migrator (02dd67c), closes #1757
- migrations: store migrations without extensions (4036716), closes #2239
- migrations: use snapshots for generating diffs in new migrations (#1815) (9c37f61)
- mongo: add
SchemaGenerator support for mongo (#2658) (cc11859)
- mongo: upgrade node-mongodb to v4 (#2425) (2e4c135)
- query-builder: add
qb.getCount() method (f773736), closes #2066
- query-builder: allow awaiting the
QueryBuilder instance (#2446) (c1c4d51)
- query-builder: improve typing of
qb.execute() (c4cfedb), closes #2396
- schema: add support for timestamp columns in mysql (a224ec9), closes #2386
- schema: allow disabling foreign key constraints (fcdb236), closes #2548
- schema: rework schema diffing (#1641) (05f15a3), closes #1486 #1518 #579 #1559 #1602 #1480 #1687
- seeder: use community driven faker fork and reexport it (3c9f8e9)
- seeder: add seeder package (#929) (2b86e22), closes #251
- sql: add
qb.indexHint() method that appends to the from clause (ce89e1f), closes #1663
- sql: add callback signature to
expr() with alias parameter (48702c7), closes #2405
- sql: allow setting transaction isolation level (6ae5fbf), closes #819
- sql: allow tuple comparison via
expr helper (90777a7), closes #2399
- sql: generate down migrations automatically (#2139) (7d78d0c)
- typings: make
em.create() and other methods strict (#1718) (e8b7119), closes #1456
- typings: make
toObject() and similar strict (#1719) (c202396)
- support flushing via
Promise.all() (f788773), closes #2412
Performance Improvements
- core: do not update entity state on forking EM (de3191c)
BREAKING CHANGES
Please see the upgrading guide.
v4
4.5.10 (2021-12-26)
Bug Fixes
- core: allow putting not managed entities to remove stack (0edb72e), closes #2395
- core: defer cascading of persist operation (7d18310), closes #2161
- core: do not override internal EM instance when forking EM (fb0abf9), closes #2342
- core: do not save entity state in
merge when it's not initialized (bdd7452), closes #1927
- core: fix assigning to object property without value (aca56e1), closes #2492
- core: fix collection state when
forceEntityConstructor is used (53d4c39), closes #2406 #2409
- core: fix reflection of enums in babel (05dee1d), closes #2198
- core: fix serialization of self referencing collections (fdbe4f4), closes #2059
- core: rehydrate custom types when using metadata cache (3ea37a6), closes #2489
- core: remove entity from its bidirectional relations after delete (c754a62), closes #2238
- embeddables: add missing serialization options to
@Embedded() (aca6d08), closes #2464
- embeddables: ensure order of discovery does not matter for embeddables (e3f9dbc), closes #2242
- embeddables: fix validating nullable object embeddables (d60dded), closes #2233
- mongo: allow using
pool.min/max options in mongo driver (830179d), closes #2228
- mongo: do not use separate update queries for M:N collections if not needed (f6383a0), closes #2483
- postgres: add extra array operators (#2467) (a1fd357)
- reflection: relative paths not stripped completely (#2164) (cbe7503)
- sqlite: patch dialect only once (a7fe71e), closes #2422
- sti: fix prototype of child entity after it gets loaded (e78942a), closes #2493 #2364
- sti: respect custom table names (b17aea9), closes #2356
- validation: validate missing 1:m mappedBy key in factory (7ef40c0), closes #2393
- update mysql2 dependency to 2.3.2 (#2376) (f9c417a)
Performance Improvements
- core: define
Reference properties on prototype (4ef2623)
- core: do not redefine
Collection properties as non-enumerable (523addd), closes #2543
- core: reuse EntityComparator on fork() (#2496) (bd2ccfd)
- core: use shared memory for cycles when computing change sets (c12ff4b), closes #2379
- core: various small performance improvements in UoW (d8ea1c2)
4.5.9 (2021-08-24)
Note: Version bump only for package @mikro-orm/core
4.5.8 (2021-08-24)
Bug Fixes
- core: detect ts-jest usage (d54ccc2)
- core: do not apply limit/offset to populate pivot table queries (1f2d430), closes #2121
- core: do not propagate mapToPk properties (c37f42e)
- query-builder: do not wipe previously defined conditions with
qb.delete() (380fe3d), closes #2136
- reflection: support virtual method properties (3a8c344)
4.5.7 (2021-06-30)
Bug Fixes
- core: fix clearing 1:m collections (29cd17b), closes #1914
- core: fix M:N relations with custom type PKs (ed399b1), closes #1930
- core: fix removing of m:n items when one is composite (8084845), closes #1961
- core: fix transaction context in nested transactions (d88dd8b), closes #1910
- core: make entity helper property non-enumerable (ce99eb2)
- core: respect filters defined on base entities (4657d05), closes #1979
- embeddables: allow using more than 10 embedded arrays (ab8e706), closes #1912
- entity-generator: fix boolean default values (219fc0c), closes #1917
- mysql: use current schema when reading enum definitions (c769871), closes #1923 #1866
- postgres: fix propagation of PKs with custom names (9ce0c37), closes #1990
Features
- cli: only warn with
useTsNode: true without ts-node available (3aa3a6c), closes #1957
4.5.6 (2021-06-06)
Bug Fixes
- core: fix extraction of child condition when populating 2 (f22eec1), closes #1882
- core: fix hydrating of inlined embeddables via
em.create() (34391cd), closes #1840
- core: fix joined strategy with FK as PK (adaa59b), closes #1902
- core: mark entity generator and migrations as peer deps of knex (4ad80af), closes #1879
- core: propagate unsetting of 1:1 from inverse side (903d484), closes #1872
- core: reset current transaction before running
afterFlush event (539311e), closes #1824
- core: support getters in
EntitySchema property types (0b831d0), closes #1867
- core: use tsconfig-paths loadConfig function (#1854) (fbfb148), closes #1849
- entity-generator: do not infer
cascade value based on update/delete rules (dca4f21), closes #1857
- mongo: fix extraction of child condition when populating (3cf30e1), closes #1891
Features
- core: add PlainObject class that DTO's can extend to treat class as POJO (#1837) (2e9c361)
4.5.5 (2021-05-17)
Bug Fixes
- core: allow using
updateNestedEntities flag with collections (db77e8b), closes #1717
- core: convert custom types for
onCreate & onUpdate (34c1aa5), closes #1751
- core: convert custom types for collection items in joined strategy (bea37e0), closes #1754
- core: convert custom types on PKs in update and delete queries (1b5270d), closes #1798
- core: do not ignore
qb.onConflict(...).merge() without params (68b570e), closes #1774
- core: ensure correct aliasing when auto-joining PKs in group conditions (ec971b6), closes #1734
- core: ensure correct casting in deep JSON queries with operators (0441967), closes #1734
- core: fix
findAndCount with populate (61bc7cf), closes #1736
- core: fix ordering by json properties (53bef71)
- core: issue delete queries after extra/collection updates (fc48890)
- core: support extending in
tsconfig.json (#1804) (6597552), closes #1792
- core: use
$and for merging of multiple filter conditions (19f3f1d), closes #1776
- mongo: validate usage of migrator and entity generator (e41d1c5), closes #1801
- query-builder: allow passing array of keys to
qb.onConflict().merge() (fc3cf01), closes #1774
- query-builder: validate missing
onConflict calls (d9ae997), closes #1803
4.5.4 (2021-04-26)
Bug Fixes
- core: consider non-plain objects as PKs (82387ad), closes #1721
- core: fix
QueryFlag.PAGINATE with joined loading strategy (11aa0a3)
- core: fix assigning embedded arrays (9ee8f5c), closes #1699
- core: fix persisting complex composite keys in m:1 relations (a932366), closes #1687
- core: fix querying by complex composite keys via entity instance (b1b7894), closes #1695
- core: fix querying by JSON properties (bc5e1a9), closes #1673
- core: fix state of entities from result cached (8d0f076), closes #1704
- core: initialize empty collections when fetch joining (6fb9560)
- core: update version values in batch updates (f5c8ed8), closes #1703
Features
- core: add
QueryFlag.AUTO_JOIN_ONE_TO_ONE_OWNER (378e468), closes #1660
4.5.3 (2021-04-09)
Bug Fixes
- core: do not auto-join composite relations when not needed (b1420a6), closes #1658
- core: ensure eager loaded relations are actually loaded (897c7bd), closes #1657
- core: fix aliasing of embeddables in update query (#1650) (6cb5f62)
- discovery: fix metadata validation of nested embeddables (1d7c123), closes #1616
- knex: find by custom types with object subconditions (#1656) (d8c328a)
- postgres: improve extra updates logic for batch updates (84b40bc), closes #1664
- postgres: fix batch inserts with PKs with custom field name (4500ca7), closes #1595
Features
- query-builder: allow passing raw query bindings via
qb.raw() (aa423a5), closes #1654
4.5.2 (2021-04-06)
Bug Fixes
- core: fix mapping of complex composite keys (c0c658e), closes #1624
- core: fix querying embeddables over cast fields (#1639) (cb5b25c)
- core: support advanced custom types in batch queries (88cc71e), closes #1625
- core: support native bigint as primary key (#1626) (bce7afe)
- knex: find entity by advanced custom types (#1630) (ef945d5)
4.5.1 (2021-03-27)
Bug Fixes
- core: create child entities that use Reference wrapper as new (b14cdcb), closes #1592
- core: support
Collection.loadCount for unidirectional M:N (27e4dd2), closes #1608
- core: support nested embeddables inside embedded arrays (088c65d), closes #1585
- core: support sql fragments in custom types with joined strategy (527579d), closes #1594
4.5.0 (2021-03-21)
Bug Fixes
- core: apply filters when populating M:N relations (cd8330a), closes #1232
- core: do not process knex.ref() via custom types (ba2ee70), closes #1538
- core: do not update entity state when cascade merging (6c74109), closes #1523
- core: expose filters in some repository methods (a1e1553), closes #1236
- core: fix auto-joining with
$not operator (8071fd0), closes #1537
- core: support operators in json property queries (cb5e715), closes #1487
- sqlite: ensure booleans are hydrated as booleans (4e36df2), closes #1553
- sqlite: fix calling
em.find() from hooks (fec3285), closes #1503
Features
- cli: allow mikro-orm config to return Promise (#1495) (629aae9)
- core: add
Collection.matching() method to allow pagination (#1502) (1ad3448), closes #334
- core: add close method to
CacheAdapter interface (2795b5a), closes #1509
- core: allow updating nested 1:1 and m:1 references with EntityAssigner (#1535) (c1dd048)
- core: infer configuration from environment variables (#1498) (1ff07a7), closes #1472
- core: support custom types in embeddables (53305d3), closes #1519
- core: support embeddable arrays (#1496) (57b605c), closes #1369
- reflection: support enum arrays and custom types (dc65527), closes #1497
- validation: validate correct reference types (381b5b9), closes #1568
4.4.4 (2021-02-21)
Bug Fixes
- cli: fix debug command with file globs (5ec60e2), closes #1465
- core: allow extending existing custom types (cc34d7e), closes #1442
- core: do not define dynamic id property if not needed (e13188f), closes #1444
- core: improve quoting of advanced custom types (cda3638)
Performance Improvements
4.4.3 (2021-02-14)
Bug Fixes
- core: handle
convertToJSValueSQL at QB level too (fbb2825), closes #1432
- core: ignore falsy values in
Collection.remove() (3447039), closes #1408
- core: propagate custom join columns to inverse side (m:n) (3f0a7b2), closes #1429
- core: quote custom type aliases (#1415) (6f6d1ec)
- core: respect
mergeObjects only for POJOs in assign helper (c5bbcee), closes #1406
- core: use generic comparison for object properties (e9073cf), closes #1395
4.4.2 (2021-02-04)
Features
4.4.1 (2021-02-01)
Bug Fixes
- core: alias pivot fields when loading m:n relations (56682be), closes #1346 #1349
- core: allow assigning null to embeddable property (#1356) (f3a091e)
- core: fix
eager relations with joined loading strategy (ba94e28), closes #1352
- migrations: fix generation of empty migrations (#1362) (7ec9f30)
- sti: respect child types when querying for STI entity (df298a1), closes #1252
- typing: improve handling of array properties (9d82ffb), closes #1077
4.4.0 (2021-01-24)
Bug Fixes
- core:
em.create() should not mutate the input object (b83b211), closes #1294
- core: allow using
lazy flag with formulas (4b2b5ce), closes #1229
- core: always make new entity snapshot (1dacf1e), closes #1334
- core: apply discriminator condition when loading STI entities (9c62370), closes #1252
- core: clear inverse references to removed entities (3a1d927), closes #1278
- core: fix creating entity graph from deeply nested structures (833d246), closes #1326
- core: fix custom types with joined loading strategy (f64e657), closes #1237
- core: fix nullable embeddables in object mode (bb8dbce), closes #1296
- core: fix pessimistic locking via
em.findOne() (a0419a4), closes #1291
- core: improve custom sql expression detection (cf8c5cd), closes #1261
- core: make PK property of
Reference required (5e1cf23)
- core: respect context when working with filter params (97ed314), closes #1312
- core: support FK as PK in
Collection.getIdentifiers() (#1225) (f8024c9), closes #1224
- entity-generator: emit collection name in decorator (#1338) (33574e8), closes #1328
- mongo: fix using custom field name on relations (44becca), closes #1279
- mysql: enforce 64 character limit for identifier names in SQL (#1297) (9c83b6d), closes #1271
- schema: fix index name with explicit schema (b62d9ec), closes #1215
- schema: fix renaming of multiple columns at the same time (677a2b7), closes #1262
- sql: sort fetch-joined properties on their orderBy (#1336) (f18cd88), closes #1331
Features
- core: add support for nested embedddables (#1311) (aee2abd), closes #1017
- core: add support for nested partial loading (#1306) (3878e6b), closes #221
- core: allow disabling identity map and change set tracking (#1307) (03da184), closes #1267
- core: allow using native private properties (fc35c22), closes #1226
- core: implement transaction lifecycle hooks (#1213) (0f81ff1), closes #1175
- core: support handling
Set as array-like input (#1277) (2945b8c)
- mysql: allow specifying collation globally (cd95572), closes #1012
- query-builder: add support for
onConflict() (b97ecb5), closes #1240
Performance Improvements
- core: make
IdentityMap iterable (e13757a)
Reverts
- Revert "chore(deps): update dependency typedoc to v0.20.1" (#1245) (b5b25e1), closes #1245
4.3.4 (2020-12-11)
Bug Fixes
- core: hydrate embeddable scalar properties (#1192) (eb73093)
- core: validate overridden properties by embeddables (#1172) (6629a08), closes #1169
- knex: reject in
commit() method if commit statement fails (#1177) (f3beb7f), closes #1176
- mariadb: fix transforming of raw results in
run mode (417a4c9)
- sql: ensure correct order of results when fetch joining (7453816), closes #1171
- sql: use
__ when aliasing fetch-joined properties (1479366), closes #1171
Features
- core: auto-discover base entities (33bda07)
4.3.3 (2020-12-04)
Bug Fixes
- cli: print both
entities and entitiesTs in debug command (90b85e4), closes #1139
- core: fix em.create() with nested relations (dde119f), closes #1150
- core: fix populating 1:m where the owner uses
mapToPk (85a7c9d), closes #1128
- core: fix propagating of changes to 1:m with
mapToPk (b38df3e), closes #1128
- core: fix snapshotting of composite properties (b5f19f2), closes #1079
- schema: allow using const enums (e02ffea), closes #1096
- schema: fix diffing tables in other than default schema (429d832), closes #1142 #1143
- sql: allow no results in
em.count() (bc3cdf6), closes #1135
- sqlite: fix querying by 1:1 relation with composite PK (0da6347), closes #1157
4.3.2 (2020-11-24)
Bug Fixes
- core: disable propagation when
mapToPk is used (6f6a204), closes #1124
- core: do not use custom toJSON when storing result cache (86ec3b3)
- core: fix comparison of object properties and bigints (2119a65), closes #1117
- core: fix computing changesets with reference as PK (5504436), closes #1111
- core: fix serialization of properties with same name (d4d9c48), closes #1115
- sql: allow using raw value for JSON prop with custom type (2a17c59), closes #1112
4.3.1 (2020-11-20)
Bug Fixes
- core: assign embedded properties from class objects (#1087) (c2b4972), closes #1083
- core: do not interpolate escaped question marks (c54c2a2)
- core: rework unique property extra updates (bd19d03), closes #1025 #1084
- postgres: use
->> to search in object embeddables (78c9373), closes #1091
- ts-morph: fix discovery of
IdentifiedReference with ts-morph (d94bd91), closes #1088
4.3.0 (2020-11-13)
Bug Fixes
- cli: add missing peer dependencies (#1057) (83bd6b3)
- core: always check remove stack when cascade persisting (a9a1bee), closes #1003
- core: do not override child class properties (#1000) (6d91f1f)
- core: ensure correct grouping and commit order for STI (8b77525), closes #845
- core: ensure correct handling of empty arrays (c9afabb)
- core: ensure correct handling of empty arrays (1c4ba75)
- core: ensure we store the right value for bigint PKs (7d7a1c9), closes #1038
- core: fix cascading when assigning collections (d40fcfa), closes #1048
- core: pin dependencies (0f3a8e5), closes #961
- deps: update dependency @docusaurus/core to v2.0.0-alpha.66 (#978) (475d3b0)
- deps: update dependency @types/mongodb to v3.5.33 (#1045) (81514d8)
- discovery: allow using absolute paths in
entities (584854c), closes #1073
- mongo: do not create collections for embeddables (a0cc877), closes #1040
- schema: do not add unique constraint to PKs (a7da03d), closes #1064
- schema: ensure we do not ignore some columns (5d7dfc1), closes #1009
- schema: fix diffing FKs in MySQL 8 (#1030) (b6f31a5)
- schema: pass entity name to
joinKeyColumnName() (fe4b7bd), closes #1026
- sql: allow using dot inside custom order by expression (11e8c56), closes #1067
- sql: convert custom types at query builder level (83d3ab2)
- sql: do not batch update unique properties (87b722a), closes #1025
- sql: fix populating M:N via joined strategy with conditions (7113827), closes #1043
- sql: implement diffing of simple scalar indexes (dc81ef0), closes #957
- sql: inline array parameters when formatting queries (a21735f), closes #1021
- sql: interpolate
?? as identifier (a3d4c09), closes #983
- sql: take snapshots of collections populated via joined strategy (5f3288a), closes #1041
- validation: don't validate inherited STI props (#998) (63d1f57), closes #997
Features
- core: allow calling
Collection.set() on not initialized collections (1d0bb85), closes #1048
- core: allow extending embeddables (#1051) (89d3250), closes #1049
- core: allow mapping
null to undefined optionally (55de84e), closes #1019
- core: allow using multiple ORM instances with RequestContext (e11040d), closes #872
- core: maintain transaction context automatically (#959) (e0064e4)
- count: initial implementation of loadCount (#955) (3371415), closes #949
- query-builder: allow mapping of complex joined results (#988) (60dd2d8), closes #932
- release: add automatic nightly releases (7f8a10c), closes #339
4.2.3 (2020-10-24)
Bug Fixes
- core: ensure
qb.getFormattedQuery() works with postgres (63b2521)
- core: ensure global filters are enabled by default (#952) (28124fb)
- core: rework access to target entity metadata from collections (10ca335), closes #956
4.2.2 (2020-10-22)
Bug Fixes
- core: fix mapping of params with custom types (e5049b1), closes #940
- schema: make sure we do not create FK columns twice in sqlite (1eb6374), closes #942
- only create migrations folder if migrationsList is not used (#941) (1e5c5e8), closes #907
- core: fix wrongly inferred 1:m metadata (82f7f0a), closes #936
Features
- core: add MetadataStorage.clear() to clear the global storage (c6fa0f4), closes #936
4.2.1 (2020-10-20)
Bug Fixes
- core: make sure refreshing of loaded entities works (45f3f42)
- core: validate object embeddable values on flush (cd38e17), closes #466
- core: validate the object passed to
em.persist() (90678c2)
4.2.0 (2020-10-18)
Bug Fixes
- core: fix propagation of conditions with operators (05acd34)
- core: reset the working state of UoW after failures (6423cf7)
- core: update umzug types to 2.3 (4668e78), closes #926
- core: use entity ctors also when all PKs are provided in
em.create() (b45b60b), closes #924
- schema: fix automatic discriminator map values in STI (7cd3c6f), closes #923
- schema: improve column type equality check (#925) (152f399)
Features
- core: add basic (in-memory) result caching (2f8253d)
- core: add native support for enum arrays (9053450), closes #476
- core: allow defining multiple entities in single file (e3ab336), closes #922
- core: allow mapping m:1/1:1 relations to PK (#921) (894f17e), closes #750
- core: allow storing embeddables as objects (#927) (ba881e6), closes #906
- serialization: rework handling of cycles (1a2d026)
4.1.1 (2020-10-14)
Bug Fixes
- postgres: escape question marks in parameters (813e3cd), closes #920
4.1.0 (2020-10-12)
Bug Fixes
- core: allow defining PKs inside
@BeforeCreate() (0a2299f), closes #893 #892
- core: do not cascade remove FK primary keys (37415ce), closes #915
- core: do not fire onInit event twice (9485f48), closes #900
- core: ensure custom types are comparable (3714a51), closes #864
- core: fix detection of custom type PKs with object value (61095ce), closes #910
- core: fix mapping of returning zero values in embeddables (e42ae4a), closes #905
- core: skip index initialization for abstract entities (#881) (a2d381f)
- migrations: always ensure the migrations folder exists (a1e0703), closes #907
- migrations: respect custom file names when running by name (80e5b58), closes #883
- mongo: filter by serialized PK inside group condition (a492a64), closes #908
- postgres: do not convert date type columns to Date js objects (2cfb145), closes #864
- schema: allow using non-abstract root entity in STI (9dd3aed), closes #874
- schema: make STI metadata discovery order independent (f477a48), closes #909
- sqlite: rework schema support for composite keys in sqlite (82e2efd), closes #887
- typings: improve inference of the entity type (67f8015), closes #876
Features
- core: add EntityRepository.merge() method (f459334), closes #868
Performance Improvements
- core: implement bulk updates in mongo driver (5f347c1), closes #732
- core: implement bulk updates in sql drivers (b005353), closes #732
- core: improve hydration performance (3cafbf3), closes #732
- core: interpolate query parameters at ORM level (742b813), closes #732
- core: optimize entity hydration (6c56a05), closes #732
- core: use batching in uow deletes (8cbb22a), closes #732
- core: use bulk inserts in all drivers (10f2e55), closes #732
- core: use dedicated identity maps for each entity (84667f9), closes #732
- core: use faster way to check number of object keys (82f3ee4), closes #732
- core: use JIT compilation for diffing entities (60f10a4), closes #732
- core: use JIT compilation for snapshotting entities (5612759), closes #732
- core: use JIT compilation in hydrator (1f06a52), closes #732
- core: use JIT compiled PK getters/serializers (0ec99dc), closes #732
- core: use raw sql for batch updates (1089c57), closes #732
4.0.7 (2020-09-24)
Bug Fixes
- core: do not store original data for references (0a9ef65), closes #864
Features
- core: add groupBy, having and schema to
CountOptions (d3c3858)
Performance Improvements
- core: use batch inserts in UoW (postgres & mongodb) (#865) (54ad928), closes #732
4.0.6 (2020-09-22)
Bug Fixes
- deps: update dependency escaya to ^0.0.49 (#854) (d4737b6)
- migrations: migrate only one version down with explicit tx (50567dd), closes #855
- query-builder: do not select 1:1 owner when auto-joining (86c3032), closes #858
- query-builder: fix auto-joining of 1:m PKs (920995f), closes #857
- query-builder: fix count query with auto-joining of 1:1 (9b8056c), closes #858
- query-builder: wrap nested array conditions with
$in operator (939989a), closes #860
4.0.5 (2020-09-21)
Bug Fixes
- core: fix merging results from QB to existing entity (218098a)
- schema: defer creating of composite indexes + implement diffing (f57b457), closes #850
Features
- mapping: make
@Unique and @Index (optionally) typesafe (afe6801), closes #850
4.0.4 (2020-09-19)
Bug Fixes
- core: allow filter condition callbacks without arguments (5b3401f), closes #847
- core: allow filter condition callbacks without arguments (da8fbfc), closes #847
- core: allow querying
ArrayType with a value (e505358), closes #844
- core: improve metadata validation of STI relations (0b97af8), closes #845
- core: update filter typing to allow async condition (#848) (2188f62)
- query-builder: fix mapping of 1:1 inverse sides (a46281e), closes #849
- query-builder: fix mapping of nested 1:1 properties (9799e70)
Features
- core: allow setting loading strategy globally (e4378ee), closes #834
- migrations: allow providing transaction context (1089c86), closes #851
Performance Improvements
- move reference to metadata to entity prototype + more improvements (#843) (f71e4c2), closes #732
4.0.3 (2020-09-15)
Bug Fixes
- core: make a copy of custom type values to allow array diffing (6ae72ae)
Features
- core: allow using
AsyncLocalStorage for request context (47cd9a5), closes #575
Performance Improvements
- core: create the helper instance early (f4f90eb)
- core: do not generate internal entity uuid (9f46aa4)
- core: do not use
em.merge() internally (6a1a6d6)
- core: remove WrappedEntity.__internal map (2228fcb)
- core: skip processing of hooks when there are no hooks (425784b)
- core: store entity identifier on entity helper (403acca)
- core: store original entity data on entity helper (6a91b01)
Bug Fixes
- core: simplify
Collection type args (1fb6cec)
Features
- entity-generator: do not use ts-morph (478a7bb)
- migrations: do not use ts-morph in migrations (9800dc1)
Bug Fixes
- core: hydrate user defined discriminator columns (#831) (8671440), closes #827
- core: refactor internals to reduce number of cycles (#830) (3994767)
Bug Fixes
- cli: custom tsconfig gets wrong path (#597) (3cdb5dd)
- core: add
RequestContext.createAsync() for Koa (ae3bc0f), closes #709
- core: allow date to be used as primary key (#609) (d421be8)
- core: allow having same property name as entity name (6b9d4cd), closes #655
- core: allow hiding PKs in
toObject() (0a920dd), closes #644
- core: allow populating FK as PK in
toJSON() (e05d780)
- core: do not cascade merge new entities (2b0f208)
- core: do not lookup in identity map with non-PK conditions (4fb0e52), closes #625
- core: do not merge entity instances in
em.create() (50aaef8)
- core: fix
em.create() with deeply nested data (#683) (a302473), closes #678
- core: fix default value for
cache.enabled (9be725f)
- core: fix extracting PK out of reference wrapper (db037dc), closes #589
- core: map values from returning clause via hydrator (c5384b4), closes #725
- core: mark all properties as populated for new entities (5f7fb8f), closes #784
- core: reset collections when assigning to those not initialized (e19a6b4)
- core: support comments in tsconfig.json (6506695), closes #730
- core: support nullable bigints (3bb2a2d), closes #631
- core: support self referencing with Reference wrapper (fd1e158), closes #610
- core: throw when trying to call
em.remove(..., null) (77c52dd)
- mapping: support mixed M:N with composite PK on one side only (a951918)
- mariadb: enable
bigNumberStrings toggle (ee90c64), closes #578
- mongo: add support for
$re operator in mongo (13fe6e5), closes #613
- postgres: time column type should be a string (#774) (237ddbf)
- query-builder: make sure
$or and $and combined works correctly (c8d3a34), closes #792
- query-builder: make sure we use the right alias in complex
$and queries (522787e), closes #786
- query-builder: use correct operators in complex and/or conditions (#803) (aca0e10)
- schema: do not create indexes for each composite PK (91b38cb), closes #760
- postgres: keep
bigint/numeric types as string (014f3b5), closes #324
- sql: pivot joining of m:n when no target entity needed directly (2b0bb72), closes #549
- sql: pivot joining of m:n when target entity is null (3b05a59), closes #548
- sql: rework implicit m:n pivot joining (7928c50)
- sql: support composite keys in
EntityCaseNamingStrategy (8d07727)
- sql: use composite FKs instead in schema generator (f5c2302)
- utils: ts-node check now runs in a webpack environment (#657) (4384019)
Features
- core: add
driver.nativeInsertMany() method (#688) (78b2341), closes #442
- core: add
em.begin/commit/rollback methods (#717) (5414c52)
- core: add
EntityRepositoryType symbol (#698) (ffae0a8), closes #696
- core: add
expr helper to allow custom expressions in EM API (39ced1b), closes #802
- core: add property serializers (3d94b93), closes #809
- core: add support for entity and property comment (#668) (c01b338)
- core: add support for filters/scopes (#663) (c1025b9), closes #385
- core: add support for flush events (#642) (1f12aff), closes #637
- core: add support for ordering by NULLS (#677) (74ee0cb), closes #675
- core: allow persisting 1:m collections (#686) (379b289), closes #467
- core: allow using
knex.raw in query params (e6b9f0e), closes #802
- core: allow using destructing assignments in entity ctors (06a5490), closes #781
- core: execute hooks via
EventManager (#623) (6a7f627), closes #622
- core: expose populate parameter in
wrap(e).init() (d33432a), closes #814
- core: readonly entity (#738) (7581592)
- core: refactor internal dependencies to support Yarn PnP (#645) (7e21bb8)
- core: refactor merging to allow querying by custom type (#800) (bfbc5f8), closes #739
- core: support globs in
entities (#618) (ee81b61), closes #605
- core: type safe references (#691) (77d64ba), closes #214
- core: use custom errors for failHandler and metadata (6db22af), closes #611
- migrations: add
Migration.execute() method (5c1f60a), closes #770
- migrations: add support for initial migrations (#818) (26b2228), closes #772
- migrations: allow specifying list of migrations (#741) (5a0f2a6), closes #705
- migrations: allow using knex in migrations (fc2fbaa), closes #799
- postgres: add
$ilike, $overlap, $contains, $contained (3c59885), closes #641
- query-builder: allow ordering by custom expressions (e4674c7), closes #707
- query-builder: make sure we do not prefix virtual props (fd0766c), closes #734
- cli: allow the use of TS path mapping (#554) (2444192)
- core: accept references in collection
add/remove/set methods (26d132f)
- core: add
connect: boolean param to MikroORM.init() (43a9ce9)
- core: add
having to FindOptions (952fd2f)
- core: add custom types for array, blob and json (#559) (7703cc5), closes #476
- core: add pagination support (
QueryFlag.PAGINATE) (#544) (d43241e)
- core: add support for alternative loading strategies (#556) (0b89d4a), closes #440
- core: add support for event subscribers (#614) (1281356), closes #516
- core: add support for lazy scalar properties (#585) (cd8c683), closes #427
- core: add support for Node.js 14 (#522) (2093af8)
- core: add support for single table inheritance (#503) (8c45339), closes #33
- core: allow adding items to not initialized collections (#489) (8be8a4d)
- core: allow adding items to not initialized collections (#489) (ca5eb64)
- core: do not cache metadata for other than ts-morph provider (#569) (49fb4eb)
- core: pass entity as parameter in
onCreate and onUpdate (#564) (3044a19)
- core: split project into multiple packages (#475) (636e861)
- core: use custom exceptions for driver related errors (#539) (2c30679)
- discovery: use both entity name and path as key in Metadat… (#488) (72f0aca)
- mapping: add support for embeddables (#514) (0fa06b1)
- migrations: support custom migration names (8ea71b6), closes #449
- mongo: add
getCollection() method to MongoEntityManager (79a9a7d)
- mongo: allow creating any kind of index in mongo (8fbe48a)
- mongo: allow using different primary key types than ObjectId (#568) (e523794), closes #349
- postgres: use
jsonb column type by default (b6c0578)
- sql: add
execute() method to SqlEntityManager (e389d40)
- sql: add
groupBy to FindOptions (2f6687a)
- sql: add
qb.raw() to allow using raw snippets in QB (c09a5b6), closes #598
- sql: add support for computed properties via
@Formula() (#553) (68b9336)
- sql: add support for sub-queries (#525) (e07f8ad)
- sql: allow delete queries with auto-joining via sub-queries (#538) (e44bc56), closes #492
- sql: allow update queries with auto-joining via sub-queries (#537) (cff9a3a), closes #319
- sql: ensure correct table order in schema generator (#617) (b3949cf)
- sql: initialize query builder in select mode (#565) (3e3abe7)
- ts-morph: add ORM version to cache invalidation logic (f28119a)
- ts-morph: infer nullability from property types (4c45e00)
- ts-morph: use
.d.ts files for ts-morph discovery (#616) (54ce064)
Performance Improvements
- cli: transpile only when using ts-node in CLI (f739f39)
- core: do not generate sql when logging disabled (f232bb3), closes #732
- core: implement bulk deletes (#757) (d83f648), closes #732
- core: improve performance of QB a bit (efc044f), closes #732
- core: improve speed of inserting new items (bfeb2e3), closes #732
- core: optimize QB for simple cases (99cfca7), closes #732
- core: reduce usage of
wrap helper internally (66ffc3b), closes #732
- core: simplify
MetadataStorage.find() method (9abbe03), closes #732
- core: use actual Map for identity maps (3645a20), closes #732
- core: use
Set instead of array for cycle lookups (dff0c9d), closes #732
- core: use
Set instead of array for stacks in UoW (12ba811), closes #732
BREAKING CHANGES
Please see the upgrading guide.
v3
Bug Fixes
- core: fix explicit usage of
joinColumn option (bcf2546), closes #425
Features
- core: allow for the number zero as a primary key (#426) (88b979a)
- core: improve ts-node detection (f1afaa6)
- core: support indexes in entity generator (#437) (90c0162), closes #421
- schema: add
safe and dropTables options to schema generator (2d2c73d), closes #416
Bug Fixes
- core: export ValidationError directly (e3e02ea), closes #404
- mongodb: do not convert payloads to ObjectId (9a9d9e0), closes #401
- mongodb: keep topmost transaction context when nesting (d921bc1), closes #400
- schema: fix schema generator in MySQL 8 (#398) (955b0ac)
- sql: do not serialize db values from custom types (894e055), closes #372
- webpack: do not analyze enum values when already provided (3efd6ca), closes #413
Features
- core: add support for composite keys (#395) (0574dc8), closes #66
- core: allow manually specifying on update/on delete clause (fc9d86a)
- discovery: validate not discovered entities used in relations (12338da)
- migrations: do not create empty migrations without -b (564e988), closes #399
- mongo: allow passing additional index options (dd3f795), closes #415
- sql: use collection snapshots to compute precise diff (#405) (d4bda99)
Bug Fixes
- core: do not re-hydrate existing entities in
EntityFactory (a727052)
- core: do not require entity reference to have collection props (3331931)
- deps: update dependency
uuid to v7 (#355) (f2a96aa)
Features
- core: add
loadItems() method to Collection (#347) (de566c5)
- core: propagate changes to 1:1 and m:1 relations (#352) (4903a48), closes #307
- core: rework commit logic of UoW to ensure right query order (#351) (52e4b8a)
Bug Fixes
- cli: do not require existing entities in generate-entities command (4d5853f), closes #340
- discovery: fix support for globbing (995a3e8), closes #341
- typing: align EntityRepository populate signature to EntityManager (#343) (ec5a30e)
Features
Bug Fixes
- core: do not reset collections too early (ad6337e), closes #312
Features
- core: add
em.populate() helper method (26d2f33), closes #310
- core: add
Reference.getEntity() and Reference.getProperty() (05dc5ce), closes #304
Bug Fixes
- core: allow object constructor parameters in entities (967f239), closes #166
- core: allow persisting 1:1 from inverse side (a1320ba), closes #210
- core: always ensure correct EM instance when merging entity (72f4525)
- core: always init collections when creating entity via em.create() (2500cf3)
- core: always query inverse side of 1:1 association (5a77a39)
- core: auto-wire 1:1 owner to inverse side (b11d316), closes #151
- core: disable auto flushing by default [BC] (#79) (3258c50), closes #63
- core: do not map null value in bool props to false (e54dbbd), closes #262
- core: do not set EM to entity until merging [BC] (#270) (d09c3ab), closes #267
- core: do not use request context in transactional/user forks (a2d7cbb), closes #182
- core: fix querying by m:n primary keys (cb568ee), closes #234
- core: ignore inverse side of 1:1 when computing change set (a2768dd), closes #183
- core: make
em.find() where parameter required (3393d52)
- core: make sure constructor params are sniffer from the constructor (fdd157c)
- core:
requireEntitiesArray should be used only for validation (066b0ea), closes #293
- deps: update dependency @docusaurus/core to ^2.0.0-alpha (#257) (82d0b3b)
- deps: update dependency @docusaurus/core to v2.0.0-alpha.38 (#260) (a8a5386)
- deps: update dependency @docusaurus/preset-classic to ^2.0.0-alpha (#258) (bfc7455)
- deps: update dependency @docusaurus/preset-classic to v2.0.0-alpha.38 (#259) (c3c80c9)
- deps: update dependency chalk to v3 (#243) (0a17eb7)
- deps: update dependency fast-deep-equal to v3 (#250) (546e950)
- deps: update dependency ts-morph to v4 (#162) (b6dd073)
- deps: update dependency ts-morph to v5 (#229) (ab66d9c)
- deps: update dependency yargs to v15 (#244) (0fe3a55)
- generator: fixed default values and types for nullable properties (#191) (1cdccd3)
- mapping: do not override user defined nullable value in m:1 and 1:1 (b22567d)
- mapping: remove deprecated
fk option from 1:m and m:1 decorators [BC] (#87) (99b436a)
- mapping: remove obsolete parameter in UnderscoreNamingStrategy (#134) (8afa9a7)
- metadata: fix lookup of path to entity file on windows with tslib (a3c2900), closes #194
- query-builder: do not ignore parent operator in complex conditions (b9c00bc), closes #247
- query-builder: do not trigger auto-joining when not needed (b7b7a46), closes #249
- query-builder: fix malformed query when populate and join are used (244db67)
- query-builder: do not auto-join already auto-joined relation (6895e08), closes #277
- schema: do not make FK fields nullable if not needed (9c0ffc1), closes #218
- schema: prefer user-defined collection names in naming strategy (28f59ec), closes #111
- serializing: add check for circular references in toObject() (f7eaabb), closes #205
- serializing: do not ignore already visited collection items (ee4b50b), closes #222
- sql: support self-referencing m:n in pivot tables (3157572)
- sql: support uuid like PKs in M:N references (#272) (2abc19f), closes #268
- sql: support $ne and $eq operators with null (5f16f0a), closes #285
Features
- cli: add
cache:generate command to warm up production cache (9b4f8b6), closes #225
- cli: add
database:import command to run external sql dumps (aea3614)
- cli: add
debug command to help with setting up the CLI (7919071), closes #136
- cli: add basic CLI tool (#102) (d20db41), closes #101
- cli: allow specifying path to tsconfig.json (00a1a4d), closes #298
- core: add support for custom types (#276) (96b2cad)
- core: add
@Repository decorator (e4ca716)
- core: add
em.findAndCount() method (1be8eb1), closes #123
- core: add
findOneOrFail method to entity manager and repository (#142) (0d57b7b), closes #133
- core: add
Reference.set() method (08cbead), closes #264
- core: add
Reference<T> wrapper to allow improved type safety (#117) (cdd44da), closes #107
- core: add
refresh parameter to FindOptions (#271) (a558935), closes #269
- core: add
WrappedEntity.toReference() method (de01463), closes #264
- core: add support for bundling with Webpack (#200) (9db3633), closes #196
- core: add support for deep nested conditions with operators (#185) (0fa78e6), closes #172
- core: add support for eager loading (93a875d), closes #168
- core: add support for enums via
@Enum() decorator (#232) (82ca105), closes #215
- core: add support for filtering and ordering of Collection items (672bf3b), closes #195
- core: add support for migrations via umzug (#209) (38ec973)
- core: add support for read connections (#116) (bc66fd6), closes #77
- core: add support for virtual property getters (#93) (f413b41), closes #82
- core: allow assigning PK to undefined/null (72167bd), closes #166
- core: allow empty where condition in
em.count() (ee62b3e), closes #163
- core: allow filtering and sorting by nested query (bc2b91f), closes #157
- core: allow populating all relations via
populate: true (1012420), closes #160
- core: allow whitelisting entity fields in
em.find() (881b114), closes #176
- core: do not require entity attribute in collection decorators (#207) (89bbeb0)
- core: improve logging - add namespaces, colors and highlighting (#109) (64376ec), closes #108
- core: propagate nested where and orderBy when populating (226af1c), closes #195
- core: simplify entity definition and rework typings of FilterQuery (#193) (a343763), closes #124 #171
- core: use composite PK in many to many relations (#204) (e73bbdb), closes #121
- core: use knex to generate sql + enable connection pooling [BC] (#76) (6d79e57), closes #64
- core: make options parameter optional in MikroORM.init() (280d9a8)
- core: support default exported entities (9065ff6), closes #294
- drivers: add native UUID postgres type (#188) (8fd89fd)
- drivers: add support for MariaDB (#120) (833834b), closes #110
- drivers: allow passing additional driver options (1ceb0c1)
- hooks: add onInit hook fired after entity is created (#92) (64e68ed), closes #83
- logging: allow logging full query including params (#155) (6050dbf)
- mapping: add
EntityCaseNamingStrategy (fc6da6b), closes #135
- mapping: add type-safe way to define relationships (423bb33), closes #146 #158
- mapping: allow overriding
getClassName() in NamingStrategy (#88) (b6700b6), closes #15
- mapping: auto-wire missing references from owner to inverse side (fc61be9), closes #149
- metadata: add
ReflectMetadataProvider, rename the ts-morph one (#240) (d740eb3), closes #235
- metadata: auto-detect optional properties (cff0dd4)
- metadata: create instance of metadata instead of static one [BC] (#91) (e4acef0)
- metadata: improve validation during metadata discovery (1bd1899), closes #114
- mongo: improve query logging, use
inspect instead of stringify (da842a3)
- postgres: use timestamps with time zone by default (bd48124), closes #161
- query-builder: allow mapping to entities directly via getResult() (beca08e)
- query-builder: add $like and $re operators (regexp support) (e6da98f)
- schema: add basic entity generator (#98) (cc48b52), closes #78
- schema: add basic schema update (#97) (9bff976)
- schema: add support for create/drop database (#237) (6e58332)
- schema: allow dropping migrations table via
schema:drop cli cmd (36402b9), closes #220
- schema: use knex in schema generator (#81) (31bc56e)
- sql: add
autoJoinOneToOneOwner option (f2db3e0), closes #248
- sql: add
forceUtcTimezone option (6bf747d), closes #181
- sql: support multiple conditions in JOINs (#94) (60b6885), closes #70
- sqlite: ensure the directory with database exists (908aba2)
- validation: validate one to one relationship metadata (ce57a3c), closes #149
- validation: warn when failing to get metadata of an entity (33ce7d3), closes #153
Performance Improvements
- core: do not cascade persist entity references (#279) (9d9e261)
- core: make Utils.prepareEntity() faster (69d2cf4)
- sql: use multi-insert when populating m:n collections (5ece088)
BREAKING CHANGES
Please see the upgrading guide.