@mikro-orm/mysql
7.2.11 · 20 Nov 2026MIT388.9k / weekRepositoryHomepagenpmAtom feed
251 stable releases, newest first, by release line. Notes are quoted as the maintainers published them.
- 6.x
6.3.6
14 Aug 2024Reading the note…
6.3.5
11 Aug 2024Reading the note…
6.3.4
6 Aug 2024Reading the note…
6.3.3
3 Aug 2024Reading the note…
6.3.2
1 Aug 2024Reading the note…
6.3.1
25 Jul 2024Reading the note…
6.3.0
18 Jul 2024core: allow
em.transactionalhandler to be synchronous
mikro-orm.io/blog/mikro-orm-6-3-released
Bug Fixes
cli: enforce
moduleResolution: 'nodenext'for CLI context (d5d7f38), closes #5514core: allow
em.transactionalhandler to be synchronouscore: allow passing
nullto optional properties inem.create()(df0db99), closes #5827core: 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()core: fix auto flush mode for
em.findAndCount()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
core: fix processing of nullable embedded arrays (01612a1), closes #5715
core: ignore existing contexts in
@CreateRequestContext()(1bb4e22), closes #5801core: improve handling of JSON properties to support numeric strings in all drivers (#5780) (fc50c5f), closes #5773
core: make
raw()accept readonly paramscore: respect
populateoption inReference.loadfor loaded relations (04fb826), closes #5711core: respect
populateOrderBywithselect-instrategy (3b83d29), closes #5693core: respect nullability of wrapped types for ScalarReference's
core: respect parent property prefix when child has
prefix: false(94367b8), closes #5642core: support for TS 5.5
core: support overloading embedded properties (#5784) (c57b528), closes #2987
core: use
NonNullableinstead of the internalDefinedtypecore: use the same transaction context in
em.refresh()(dd17706), closes #5753core: using EntityData<Entity, true> now works with IType
entity-generator: correctly serialize string prefixes in embedded references
entity-generator: fix handling of primary keys that are foreign keys or enums
entity-generator: fixed default values for enums
entity-generator: generate all bidirectional relations in case of conflicts (#5779) (af845f1), closes #5738
entity-generator: include all entity options in EntitySchema definitions
entity-generator: output all DB related info even for virtual properties
entity-generator: output entity and prop comments
entity-generator: support complex enum names and values
entity-generator: when using esmImport, FKs are now wrapped with Rel
mssql: add proper support for MSSQL's native "varchar" type
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
vectortype (9eadac1), closes #5739postgres: put new native enum values into the correct position (f79e3bc), closes #5791
postgresql: ignore tables that use inheritance during schema diffing
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
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
useTsNodecore: addz
Platform.getDefaultVarcharLengthand optionalType.getDefaultLengthcore: allow passing
raw()intoonConflictFieldsof upsert methods (#5691) (bff90f2), closes #5668core: allow upserting without a unique value
core: check for ORM extensions dynamically
core: implement "character" type (DB type "char")
entity-generator: add a coreImportsPrefix option
entity-generator: added option to output pure pivot tables
entity-generator: added the ability to add extra names to be imported
entity-generator: allow custom types for scalar relations
entity-generator: enable the generator to dictate import specs via
extraImportentity-generator: repository class reference can be added from hooks
entity-generator: support adding groups through metadata hooks
libsql: support connecting to remote turso database
migrations: allow initial migration to be blank if no entities are defined
migrations: make
--blankalso generate adownmigrationpostgres: allow specifying deferred mode on unique constraints
postgres: support
on delete set null/defaultwith subset of columns (5353e6a), closes #5568postresql: add support for varchar with unlimited length
query-builder: infer
Loadedhint based onjoinAndSelectcalls
Performance Improvements
6.2.9
31 May 2024Reading the note…
6.2.8
21 May 2024Reading the note…
6.2.7
18 May 2024Reading the note…
6.2.6
14 May 2024Reading the note…
6.2.5
5 May 2024Reading the note…
6.2.4
2 May 2024Reading the note…
6.2.3
24 Apr 2024Reading the note…
6.2.2
20 Apr 2024Reading the note…
6.2.1
12 Apr 2024Reading the note…
6.2.0
9 Apr 2024core: do not select 1:1 owning FK twice
core: fix support for custom repositories in
@CreateRequestContexton type level
mikro-orm.io/blog/mikro-orm-6-2-released
Bug Fixes
core: do not select 1:1 owning FK twice
core: fix querying by embedded properties inside relations (2e74699), closes #5391
core: fix support for custom repositories in
@CreateRequestContexton type levelcore: 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
core: respect custom
EntityManagertype inem.fork()(bb1a3f9), closes #5415core: support passing
Configurationinstance toMikroORM.init(54a37d0), closes #5413entity-generator: allow arbitrary class and prop names as identifiers
mariadb: rework pagination mechanism to fix extra results
mysql: support
order by nulls first/lastfor raw query fragments in order by keyspostgres: drop text enum check constraints only when necessary (#5414) (5162345), closes #4112
postgres: removed erroneous duplicates in FK discovery query
query-builder: fix serialization hint of nested
qb.joinAndSelect()callsschema: improve detection of renamed columns
schema: rework dropping columns to support custom schemas and merge drop column queries
Features
core: add support for serialization groups
core: allow better type-safety for custom types via
ITypecore: allow configuring
driverOptionson replica levelcore: include all dirty collections to
UoW.getCollectionUpdates()core: make
assignoptions configurable globally (bc9f6f5), closes #5410mssql: add MS SQL Server driver (#1375) (eeaad45), closes #771
postgres: allow defining deferred FK constraints (#5384) (f42d171), closes #5306
query-builder: add
limit 1when executing query viagetSingleResult()orexecute('get')(c2b22e8), closes #5379query-builder: add
qb.getLoggerContext()andqb.setLoggerContext()(779fa15), closes #5358schema: allow configuring
updateRuleanddeleteRulefor pivot tablesschema: improve
orm.schema.execute()to support executing batchesschema: support recreating the whole database via
orm.schema.refreshDatabase()
Performance Improvements
core: optimize metadata discovery
query-builder: remove unnecessary join branches when pagination is applied
6.1.12
24 Mar 2024Reading the note…
6.1.11
18 Mar 2024Reading the note…
6.1.10
14 Mar 2024Reading the note…
6.1.9
10 Mar 2024Reading the note…
6.1.8
6 Mar 2024Reading the note…
6.1.7
4 Mar 2024Reading the note…
6.1.6
28 Feb 2024Reading the note…
6.1.5
21 Feb 2024Reading the note…
6.1.4
16 Feb 2024Reading the note…
6.1.3
13 Feb 2024Reading the note…
6.1.2
11 Feb 2024Reading the note…
6.1.1
10 Feb 2024Reading the note…
6.1.0
4 Feb 2024core: fix broken inference of
AutoPathin TS 5.4
Bug Fixes
core: allow
CacheAdapter.getto returnPromise<undefined>(#5200) (98ce1e5), closes #5199core: fix broken inference of
AutoPathin TS 5.4core: handle possible match between virtual property name and another property's field name (7fc779f), closes #5191
core: make
wrap(e, true).__emcorrectly typed toEntityManagercore: process upsert data to allow using entity instances in place of relations (9305653), closes #5165
core: respect
upsertManyoptions when batching (d6d1381), closes #5209core: respect hidden properties of composite PKs during serialization (3d1cba3), closes #5203
postgres: improve diffing of native postgres enums (49d6b4d), closes #5108
query-builder: support
convertToJSValueSQLon returning statement of update queries (2e1d6c8), closes #5176
Features
core: add second EM parameter to
onCreateandonUpdatecallback (a964aeb), closes #5201core: 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 #5188entity-generator: allow post processing the metadata (#5113) (e82058f), closes #5010
knex: add
loggerContextparameter toem.execute
6.0.7
30 Jan 2024Reading the note…
6.0.6
29 Jan 2024Reading the note…
6.0.5
18 Jan 2024Reading the note…
6.0.4
15 Jan 2024Reading the note…
6.0.3
13 Jan 2024Reading the note…
6.0.2
9 Jan 2024Reading the note…
6.0.1
8 Jan 2024Reading the note…
6.0.0
8 Jan 2024core: allow using classes with private constructor with
EntitySchemacore: do not load all env vars from
.envfiles automatically
mikro-orm.io/blog/mikro-orm-6-released
Bug Fixes
core: allow using classes with private constructor with
EntitySchemacore: collection.loadItems() should respect wildcard populate (7f3065f), closes #4977
core: do not load all env vars from
.envfiles automaticallycore: ensure correct serialization of not fully populated collections
core: ensure propagation and change-tracking works with
useDefineForClassFields(#4730) (83f24aa), closes #4216core: fix automatic calling of
ensureDatabaseoninitcore: fix hydration of complex FKs with joined strategy
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
EntitySchematyping forrepositoryoption (37ee42e), closes #5006core: make
em.createstrictly typed for relations too (#4752) (3535cc0), closes #4748core: make
Loadedtype more flexible (c95e3b6), closes #3277core: mark
Reference.set()as private (#5017) (5aebf0b), closes #5003core: refactor mapping of
Dateproperties (#4391) (3a80369), closes #4362 #4360 #1476core: respect
@Indexand@Uniquedecorators on embeddablescore: respect global
schemaoption in first level cachecore: respect schema option for entity instances in
em.insert/Many(7eae031), closes #4424core: return managed entity from
em.refresh()core: return managed entity from
em.refresh()core: rework
Collectioninitialization to useem.populate()(#4571) (7495142), closes #4464core: rework pivot table joining (#4438) (0506d36), closes #4423
core: support embedded properties with conflicting property names (b43ef63), closes #5065
core: use
join onconditions forpopulateWhere(#4025) (a03e57c), closes #3871entity-generator: use index expressions for complex indexes (e.g. conditional) (64a39f8), closes #4911
knex: respect connection type in
em.getKnex()mongo: don't rename
idto_idfor embeddables and entities without serialized PK (0cee82d), closes #4960postgres: 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
sql: do not alias conditions for update queries with collection operators (5820d66), closes #4956
sql: do not branch to-many joins for
$andwith a single item
Features
core: add
@EnsureRequestContextdecorator + rename@UseRequestContext(5e088ae), closes #4009core: add
Collection.load()methodcore: add
EagerPropssymbol to respect eager props on type levelcore: add
em.findAll()with optionalwhereoption (#4946) (23b0551), closes #3982core: add
FindOptions.excludecore: add
GeneratedCacheAdapterfor production usage (#4167) (bd478af), closes #4164core: add
Hiddentype as an alternative toHiddenPropssymbolcore: add
HiddenPropssymbol as type-level companion forhidden: true(7984769), closes #4093core: add
MikroORM.initSync()helper (#4166) (8b1a1fa), closes #4164core: add
Opttype as an alternative toOptionalPropssymbolcore: add
orm.checkConnection()helper (#4961) (b868f02), closes #4959core: add
ScalarRefandEntityReftypes to allow explicit control (1ef7856), closes #4907core: add
sql.now(),sql.lower()andsql.upper()functionscore: add
sql.ref()helpercore: add cursor-based pagination via
em.findByCursor()core: add customizable
LoggerContextwith labeling support (#4233) (b985646), closes #4230core: add discovery hooks
onMetadataandafterDiscoveredcore: add entity to identity map on
em.persist()(1b09d26), closes #4905core: add global
serialization.forceObjectoption (731087d), closes #4881core: add optional
Type.compareValuesmethod to allow custom comparators (732307a), closes #4870core: add support for indexes on JSON properties (#4735) (82c8629), closes #1230
core: allow all
CountOptionsinCollection.loadCount()core: allow auto-discovery of base classes with
EntitySchemacore: allow class references in
subscribersarray (7c8f776), closes #4231core: allow configuring filters in
Reference.load()andCollection.load()(#5025) (06012f7), closes #4975core: allow defining
serialization.forceObject: trueon type levelcore: allow disabling colors via
colorsORM config option (1bcaf09), closes #5037core: allow extending
EntityManagercore: allow inferring populate hint from filter via
populate: ['$infer'](#4939) (080fdbb), closes #1309core: allow M:1 and 1:1 relations in virtual entities
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
--configcore: allow passing string values for
PopulateHintenum (populateWhere)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 #4920core: allow using
Refwrapper on scalar propertiescore: allow using dataloader for references and collections (#4321) (8f4790f), closes #266
core: allow using string values for
loadStrategyandflushModecore: auto-join M:1 and 1:1 relations with filters (#5063) (66a6b75), closes #4975
core: improve validation of bidirectional 1:1 relations
core: infer property type from default value (#4150) (38be986), closes #4060
core: make
em.insert/Manystrictly typed (require all properties)core: native
BigIntsupportcore: re-export the core package from all drivers
core: remove static require calls (#3814) (b58f476), closes #3743
core: require
mappedByoption for 1:m propertiescore: require explicitly marked raw queries via
raw()helpercore: respect
ignoreFieldson type level inwrap().toObject()(15de7a0), closes #4198core: respect
schemaparameter inclientUrl(#4998) (9176ee0), closes #4997core: 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
Loadedtype fromRef.load()(bc3ffa9), closes #3755core: return single entity from
em.populate()when called on single entitycore: 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 #3657core: 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
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
entity-generator: allow generating scalar properties for FKs (#4892) (abad6ca), closes #4898
entity-generator: allow local and global configuration of all options
entity-generator: allow overriding generated entity file name (4ebc8e3), closes #5026
entity-generator: detect more ManyToMany relations
entity-generator: generate
OptionalPropsand other symbols forEntitySchemamysql: support
order by nulls first/last(#5021) (df75b24), closes #5004postgres: 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/clearsql: add native support for generated columns
sql: print number of affected rows for insert and update queries
sql: rework joined strategy to support the default
populateWhere: 'all'sql: support
$some,$noneand$everysubquery operators (#4917) (50d2265), closes #2916sql: use joined strategy as default for SQL drivers
sql: use returning statements for reloading version fields on update
Performance Improvements
core: cache if entity has event listeners
core: optimize handling of FK value propagation
core: speed up detection of constructor/toJSON parameters during discovery
Breaking changes
Please see the upgrading guide.
- 5.x
5.9.8
4 Feb 2024Bug Fixes
core: do not mutate data provided to
em.upsert/Many(5acb4eb), closes #5136core: ensure
em.insertManyreturns array of PKs for a single item too (#5180) (b9a55e5), closes #5179core: process upsert data to allow using entity instances in place of relations (42e3c5e), closes #5165
mongo: ensure
assignon object properties won't ignore changes (bd22d7c), closes #5158postgres: parse timestamp dates less than year 1000
5.9.7
30 Dec 2023Reading the note…
5.9.6
21 Dec 2023Reading the note…
5.9.5
15 Dec 2023Reading the note…
5.9.4
17 Nov 2023Reading the note…
5.9.3
6 Nov 2023Reading the note…
5.9.2
2 Nov 2023Reading the note…
5.9.1
31 Oct 2023Reading the note…
5.9.0
24 Oct 2023- Removed
core: remove some computed properties from metadata cache
Bug Fixes
core: apply
convertToJSValueSQLon composite FKs too (41425cb), closes #4843core: clean up removed entities from relations in identity map (1e3bb0e), closes #4863
core: infer property type from
columnTypefor non-inferrable types (e.g. unions withnull) (6bc116a), closes #4833- Removed
core: remove some computed properties from metadata cache
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 #2929query-builder: respect
preferReadReplicasinQueryBuilder(22e140e), closes #4847serialization: run custom serializer on getters (#4860) (e76836e), closes #4859
Features
5.8.10
18 Oct 2023Reading the note…
5.8.9
15 Oct 2023Reading the note…
5.8.8
11 Oct 2023Reading the note…
A whole project to check? Paste its package.json in the dependency check: every deprecated, outdated or vulnerable dependency, with what to upgrade to. Free, no account.