mikro-orm

TypeScript ORM for Node.js based on Data Mapper, Unit of Work and Identity Map patterns. Supports MongoDB, MySQL, MariaDB, MS SQL Server, PostgreSQL and SQLite/libSQL databases.

MIT License

Downloads
5.6M
Stars
7.2K
Committers
255

Bot releases are hidden (Show)

mikro-orm - v5.5.1

Published by B4nan almost 2 years ago

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
mikro-orm - v5.5.0

Published by B4nan almost 2 years ago

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)
mikro-orm - v5.4.2

Published by B4nan about 2 years ago

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)
mikro-orm - v5.4.1

Published by B4nan about 2 years ago

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)
mikro-orm - v5.4.0

Published by B4nan about 2 years ago

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)
mikro-orm - v5.3.1

Published by B4nan about 2 years ago

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
mikro-orm - v5.3.0

Published by B4nan about 2 years ago

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
mikro-orm - v5.2.4

Published by B4nan about 2 years ago

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
mikro-orm - v5.2.3

Published by B4nan over 2 years ago

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)
mikro-orm - v5.2.2

Published by B4nan over 2 years ago

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)
mikro-orm - v5.2.1

Published by B4nan over 2 years ago

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
mikro-orm - v5.2.0

Published by B4nan over 2 years ago

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)
mikro-orm - v5.1.5

Published by B4nan over 2 years ago

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
mikro-orm - v5.1.4

Published by B4nan over 2 years ago

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)
mikro-orm - v5.1.3

Published by B4nan over 2 years ago

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)
mikro-orm - v5.1.2

Published by B4nan over 2 years ago

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)
mikro-orm - v5.1.1

Published by B4nan over 2 years ago

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
mikro-orm - v5.1.0

Published by B4nan over 2 years ago

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
mikro-orm - v5.0.5

Published by B4nan over 2 years ago

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
mikro-orm - v5.0.4

Published by B4nan over 2 years ago

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
Package Rankings
Top 0.84% on Npmjs.org
Top 6.72% on Proxy.golang.org
Badges
Extracted from project README
NPM version NPM dev version Chat on discord Downloads Coverage Status Maintainability Build Status
Related Projects