@mikro-orm/core 7.0.0-dev.33 → 7.0.0-dev.331

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (218) hide show
  1. package/EntityManager.d.ts +70 -75
  2. package/EntityManager.js +487 -402
  3. package/MikroORM.d.ts +45 -38
  4. package/MikroORM.js +123 -156
  5. package/README.md +7 -4
  6. package/cache/FileCacheAdapter.d.ts +2 -7
  7. package/cache/FileCacheAdapter.js +35 -30
  8. package/cache/GeneratedCacheAdapter.d.ts +1 -2
  9. package/cache/GeneratedCacheAdapter.js +6 -8
  10. package/cache/MemoryCacheAdapter.d.ts +1 -2
  11. package/cache/MemoryCacheAdapter.js +8 -8
  12. package/cache/index.d.ts +1 -2
  13. package/cache/index.js +0 -2
  14. package/connections/Connection.d.ts +12 -5
  15. package/connections/Connection.js +37 -15
  16. package/drivers/DatabaseDriver.d.ts +25 -18
  17. package/drivers/DatabaseDriver.js +144 -45
  18. package/drivers/IDatabaseDriver.d.ts +118 -23
  19. package/entity/BaseEntity.d.ts +63 -4
  20. package/entity/BaseEntity.js +0 -3
  21. package/entity/Collection.d.ts +95 -31
  22. package/entity/Collection.js +487 -139
  23. package/entity/EntityAssigner.js +37 -25
  24. package/entity/EntityFactory.d.ts +8 -9
  25. package/entity/EntityFactory.js +152 -100
  26. package/entity/EntityHelper.d.ts +2 -2
  27. package/entity/EntityHelper.js +69 -27
  28. package/entity/EntityLoader.d.ts +12 -13
  29. package/entity/EntityLoader.js +286 -125
  30. package/entity/EntityRepository.d.ts +28 -8
  31. package/entity/EntityRepository.js +8 -2
  32. package/entity/PolymorphicRef.d.ts +12 -0
  33. package/entity/PolymorphicRef.js +18 -0
  34. package/entity/Reference.d.ts +3 -8
  35. package/entity/Reference.js +62 -29
  36. package/entity/WrappedEntity.d.ts +7 -10
  37. package/entity/WrappedEntity.js +6 -7
  38. package/entity/defineEntity.d.ts +472 -313
  39. package/entity/defineEntity.js +134 -290
  40. package/entity/index.d.ts +2 -2
  41. package/entity/index.js +2 -2
  42. package/entity/utils.d.ts +6 -1
  43. package/entity/utils.js +46 -11
  44. package/entity/validators.d.ts +11 -0
  45. package/entity/validators.js +66 -0
  46. package/enums.d.ts +8 -6
  47. package/enums.js +13 -17
  48. package/errors.d.ts +26 -16
  49. package/errors.js +63 -31
  50. package/events/EventManager.d.ts +3 -5
  51. package/events/EventManager.js +37 -26
  52. package/events/index.d.ts +1 -1
  53. package/events/index.js +0 -1
  54. package/exceptions.js +9 -2
  55. package/hydration/Hydrator.js +1 -2
  56. package/hydration/ObjectHydrator.d.ts +5 -6
  57. package/hydration/ObjectHydrator.js +109 -50
  58. package/index.d.ts +2 -2
  59. package/index.js +1 -2
  60. package/logging/DefaultLogger.d.ts +1 -1
  61. package/logging/DefaultLogger.js +3 -4
  62. package/logging/SimpleLogger.d.ts +1 -1
  63. package/logging/colors.d.ts +1 -1
  64. package/logging/colors.js +4 -6
  65. package/logging/index.d.ts +2 -1
  66. package/logging/index.js +1 -1
  67. package/logging/inspect.d.ts +2 -0
  68. package/logging/inspect.js +11 -0
  69. package/metadata/EntitySchema.d.ts +47 -23
  70. package/metadata/EntitySchema.js +103 -34
  71. package/metadata/MetadataDiscovery.d.ts +65 -18
  72. package/metadata/MetadataDiscovery.js +940 -424
  73. package/metadata/MetadataProvider.d.ts +11 -2
  74. package/metadata/MetadataProvider.js +71 -2
  75. package/metadata/MetadataStorage.d.ts +11 -13
  76. package/metadata/MetadataStorage.js +79 -48
  77. package/metadata/MetadataValidator.d.ts +32 -9
  78. package/metadata/MetadataValidator.js +214 -44
  79. package/metadata/discover-entities.d.ts +5 -0
  80. package/metadata/discover-entities.js +40 -0
  81. package/metadata/index.d.ts +1 -1
  82. package/metadata/index.js +0 -1
  83. package/metadata/types.d.ts +577 -0
  84. package/metadata/types.js +1 -0
  85. package/naming-strategy/AbstractNamingStrategy.d.ts +16 -4
  86. package/naming-strategy/AbstractNamingStrategy.js +26 -5
  87. package/naming-strategy/EntityCaseNamingStrategy.d.ts +3 -3
  88. package/naming-strategy/EntityCaseNamingStrategy.js +7 -6
  89. package/naming-strategy/MongoNamingStrategy.d.ts +3 -3
  90. package/naming-strategy/MongoNamingStrategy.js +6 -6
  91. package/naming-strategy/NamingStrategy.d.ts +28 -4
  92. package/naming-strategy/UnderscoreNamingStrategy.d.ts +3 -3
  93. package/naming-strategy/UnderscoreNamingStrategy.js +6 -6
  94. package/naming-strategy/index.d.ts +1 -1
  95. package/naming-strategy/index.js +0 -1
  96. package/not-supported.d.ts +2 -0
  97. package/not-supported.js +8 -0
  98. package/package.json +47 -36
  99. package/platforms/ExceptionConverter.js +1 -1
  100. package/platforms/Platform.d.ts +33 -15
  101. package/platforms/Platform.js +125 -69
  102. package/serialization/EntitySerializer.d.ts +6 -3
  103. package/serialization/EntitySerializer.js +54 -30
  104. package/serialization/EntityTransformer.js +37 -22
  105. package/serialization/SerializationContext.d.ts +10 -14
  106. package/serialization/SerializationContext.js +24 -19
  107. package/types/ArrayType.d.ts +1 -1
  108. package/types/ArrayType.js +2 -3
  109. package/types/BigIntType.js +1 -1
  110. package/types/BlobType.d.ts +0 -1
  111. package/types/BlobType.js +0 -3
  112. package/types/BooleanType.d.ts +1 -0
  113. package/types/BooleanType.js +3 -0
  114. package/types/DecimalType.js +2 -2
  115. package/types/DoubleType.js +1 -1
  116. package/types/EnumArrayType.js +1 -2
  117. package/types/JsonType.d.ts +1 -1
  118. package/types/JsonType.js +7 -2
  119. package/types/TinyIntType.js +1 -1
  120. package/types/Type.d.ts +2 -4
  121. package/types/Type.js +3 -3
  122. package/types/Uint8ArrayType.d.ts +0 -1
  123. package/types/Uint8ArrayType.js +1 -4
  124. package/types/UuidType.d.ts +2 -0
  125. package/types/UuidType.js +14 -2
  126. package/types/index.d.ts +3 -2
  127. package/typings.d.ts +427 -170
  128. package/typings.js +100 -45
  129. package/unit-of-work/ChangeSet.d.ts +4 -6
  130. package/unit-of-work/ChangeSet.js +8 -9
  131. package/unit-of-work/ChangeSetComputer.d.ts +2 -12
  132. package/unit-of-work/ChangeSetComputer.js +61 -38
  133. package/unit-of-work/ChangeSetPersister.d.ts +10 -17
  134. package/unit-of-work/ChangeSetPersister.js +136 -73
  135. package/unit-of-work/CommitOrderCalculator.d.ts +13 -14
  136. package/unit-of-work/CommitOrderCalculator.js +22 -20
  137. package/unit-of-work/IdentityMap.d.ts +12 -3
  138. package/unit-of-work/IdentityMap.js +51 -13
  139. package/unit-of-work/UnitOfWork.d.ts +39 -23
  140. package/unit-of-work/UnitOfWork.js +441 -246
  141. package/utils/AbstractMigrator.d.ts +101 -0
  142. package/utils/AbstractMigrator.js +303 -0
  143. package/utils/AbstractSchemaGenerator.d.ts +5 -5
  144. package/utils/AbstractSchemaGenerator.js +30 -18
  145. package/utils/AsyncContext.d.ts +6 -0
  146. package/utils/AsyncContext.js +42 -0
  147. package/utils/Configuration.d.ts +647 -185
  148. package/utils/Configuration.js +215 -252
  149. package/utils/ConfigurationLoader.d.ts +1 -52
  150. package/utils/ConfigurationLoader.js +1 -330
  151. package/utils/Cursor.d.ts +3 -6
  152. package/utils/Cursor.js +32 -17
  153. package/utils/DataloaderUtils.d.ts +10 -5
  154. package/utils/DataloaderUtils.js +42 -22
  155. package/utils/EntityComparator.d.ts +21 -21
  156. package/utils/EntityComparator.js +224 -118
  157. package/utils/QueryHelper.d.ts +34 -7
  158. package/utils/QueryHelper.js +183 -72
  159. package/utils/RawQueryFragment.d.ts +28 -34
  160. package/utils/RawQueryFragment.js +37 -72
  161. package/utils/RequestContext.js +2 -2
  162. package/utils/TransactionContext.js +2 -2
  163. package/utils/TransactionManager.js +11 -8
  164. package/utils/Utils.d.ts +16 -127
  165. package/utils/Utils.js +104 -402
  166. package/utils/clone.js +13 -23
  167. package/utils/env-vars.d.ts +7 -0
  168. package/utils/env-vars.js +98 -0
  169. package/utils/fs-utils.d.ts +20 -0
  170. package/utils/fs-utils.js +193 -0
  171. package/utils/index.d.ts +1 -3
  172. package/utils/index.js +1 -3
  173. package/utils/upsert-utils.d.ts +9 -4
  174. package/utils/upsert-utils.js +51 -5
  175. package/decorators/Check.d.ts +0 -3
  176. package/decorators/Check.js +0 -13
  177. package/decorators/CreateRequestContext.d.ts +0 -3
  178. package/decorators/CreateRequestContext.js +0 -32
  179. package/decorators/Embeddable.d.ts +0 -8
  180. package/decorators/Embeddable.js +0 -11
  181. package/decorators/Embedded.d.ts +0 -12
  182. package/decorators/Embedded.js +0 -18
  183. package/decorators/Entity.d.ts +0 -33
  184. package/decorators/Entity.js +0 -12
  185. package/decorators/Enum.d.ts +0 -9
  186. package/decorators/Enum.js +0 -16
  187. package/decorators/Filter.d.ts +0 -2
  188. package/decorators/Filter.js +0 -8
  189. package/decorators/Formula.d.ts +0 -4
  190. package/decorators/Formula.js +0 -15
  191. package/decorators/Indexed.d.ts +0 -19
  192. package/decorators/Indexed.js +0 -20
  193. package/decorators/ManyToMany.d.ts +0 -42
  194. package/decorators/ManyToMany.js +0 -14
  195. package/decorators/ManyToOne.d.ts +0 -34
  196. package/decorators/ManyToOne.js +0 -14
  197. package/decorators/OneToMany.d.ts +0 -28
  198. package/decorators/OneToMany.js +0 -17
  199. package/decorators/OneToOne.d.ts +0 -28
  200. package/decorators/OneToOne.js +0 -7
  201. package/decorators/PrimaryKey.d.ts +0 -8
  202. package/decorators/PrimaryKey.js +0 -20
  203. package/decorators/Property.d.ts +0 -250
  204. package/decorators/Property.js +0 -32
  205. package/decorators/Transactional.d.ts +0 -14
  206. package/decorators/Transactional.js +0 -28
  207. package/decorators/hooks.d.ts +0 -16
  208. package/decorators/hooks.js +0 -47
  209. package/decorators/index.d.ts +0 -17
  210. package/decorators/index.js +0 -17
  211. package/entity/ArrayCollection.d.ts +0 -118
  212. package/entity/ArrayCollection.js +0 -407
  213. package/entity/EntityValidator.d.ts +0 -19
  214. package/entity/EntityValidator.js +0 -150
  215. package/metadata/ReflectMetadataProvider.d.ts +0 -8
  216. package/metadata/ReflectMetadataProvider.js +0 -44
  217. package/utils/resolveContextProvider.d.ts +0 -10
  218. package/utils/resolveContextProvider.js +0 -28
@@ -3,6 +3,7 @@ import { helper } from '../entity/wrap.js';
3
3
  import { Reference } from '../entity/Reference.js';
4
4
  import { Utils } from './Utils.js';
5
5
  export class DataloaderUtils {
6
+ static DataLoader;
6
7
  /**
7
8
  * Groups identified references by entity and returns a Map with the
8
9
  * class name as the index and the corresponding primary keys as the value.
@@ -10,7 +11,7 @@ export class DataloaderUtils {
10
11
  static groupPrimaryKeysByEntityAndOpts(refsWithOpts) {
11
12
  const map = new Map();
12
13
  for (const [ref, opts] of refsWithOpts) {
13
- /* The key is a combination of the className and a stringified version if the load options because we want
14
+ /* The key is a combination of the uniqueName (a unique table name based identifier) and a stringified version if the load options because we want
14
15
  to map each combination of entities/options into separate find queries in order to return accurate results.
15
16
  This could be further optimized finding the "lowest common denominator" among the different options
16
17
  for each Entity and firing a single query for each Entity instead of Entity+options combination.
@@ -23,7 +24,7 @@ export class DataloaderUtils {
23
24
  Thus such approach should probably be configurable, if not opt-in.
24
25
  NOTE: meta + opts multi maps (https://github.com/martian17/ds-js) might be a more elegant way
25
26
  to implement this but not necessarily faster. */
26
- const key = `${helper(ref).__meta.className}|${JSON.stringify(opts ?? {})}`;
27
+ const key = `${helper(ref).__meta.uniqueName}|${JSON.stringify(opts ?? {})}`;
27
28
  let primaryKeysSet = map.get(key);
28
29
  if (primaryKeysSet == null) {
29
30
  primaryKeysSet = new Set();
@@ -41,9 +42,10 @@ export class DataloaderUtils {
41
42
  return async (refsWithOpts) => {
42
43
  const groupedIdsMap = DataloaderUtils.groupPrimaryKeysByEntityAndOpts(refsWithOpts);
43
44
  const promises = Array.from(groupedIdsMap).map(([key, idsSet]) => {
44
- const className = key.substring(0, key.indexOf('|'));
45
+ const uniqueName = key.substring(0, key.indexOf('|'));
45
46
  const opts = JSON.parse(key.substring(key.indexOf('|') + 1));
46
- return em.find(className, Array.from(idsSet), opts);
47
+ const meta = em.getMetadata().getByUniqueName(uniqueName);
48
+ return em.find(meta.class, Array.from(idsSet), opts);
47
49
  });
48
50
  await Promise.all(promises);
49
51
  /* Instead of assigning each find result to the original reference we use a shortcut
@@ -69,7 +71,7 @@ export class DataloaderUtils {
69
71
  The value is another Map which we can use to filter the find query to get results pertaining to the collections that have been dataloaded:
70
72
  its keys are the props we are going to filter to and its values are the corresponding PKs.
71
73
  */
72
- const key = `${col.property.targetMeta.className}|${JSON.stringify(opts ?? {})}`;
74
+ const key = `${col.property.targetMeta.uniqueName}|${JSON.stringify(opts ?? {})}`;
73
75
  let filterMap = entitiesMap.get(key); // We are going to use this map to filter the entities pertaining to the collections that have been dataloaded.
74
76
  if (filterMap == null) {
75
77
  filterMap = new Map();
@@ -96,31 +98,33 @@ export class DataloaderUtils {
96
98
  */
97
99
  static entitiesAndOptsMapToQueries(entitiesAndOptsMap, em) {
98
100
  return Array.from(entitiesAndOptsMap, async ([key, filterMap]) => {
99
- const className = key.substring(0, key.indexOf('|'));
101
+ const uniqueName = key.substring(0, key.indexOf('|'));
100
102
  const opts = JSON.parse(key.substring(key.indexOf('|') + 1));
101
- const res = await em.find(className, opts?.where != null && Object.keys(opts.where).length > 0 ?
102
- {
103
+ const meta = em.getMetadata().getByUniqueName(uniqueName);
104
+ const res = await em.find(meta.class, opts?.where != null && Object.keys(opts.where).length > 0
105
+ ? {
103
106
  $and: [
104
107
  {
105
108
  $or: Array.from(filterMap.entries()).map(([prop, pks]) => {
106
- return ({ [prop]: Array.from(pks) });
109
+ return { [prop]: Array.from(pks) };
107
110
  }),
108
111
  },
109
112
  opts.where,
110
113
  ],
111
- } : {
112
- // The entries of the filter Map will be used as the values of the $or operator
113
- $or: Array.from(filterMap.entries()).map(([prop, pks]) => {
114
- return ({ [prop]: Array.from(pks) });
115
- }),
116
- }, {
114
+ }
115
+ : {
116
+ // The entries of the filter Map will be used as the values of the $or operator
117
+ $or: Array.from(filterMap.entries()).map(([prop, pks]) => {
118
+ return { [prop]: Array.from(pks) };
119
+ }),
120
+ }, {
117
121
  ...opts,
118
122
  // We need to populate the inverse side of the relationship in order to be able to later retrieve the PK(s) from its item(s)
119
123
  populate: [
120
- ...(opts.populate === false ? [] : opts.populate ?? []),
124
+ ...(opts.populate === false ? [] : (opts.populate ?? [])),
121
125
  ...Array.from(filterMap.keys()).filter(
122
126
  // We need to do so only if the inverse side is a collection, because we can already retrieve the PK from a reference without having to load it
123
- prop => em.getMetadata(className).properties[prop]?.ref !== true),
127
+ prop => meta.properties[prop]?.ref !== true),
124
128
  ],
125
129
  });
126
130
  return [key, res];
@@ -163,11 +167,11 @@ export class DataloaderUtils {
163
167
  // We need to filter the results in order to map each input collection
164
168
  // to a subset of each query matching the collection items.
165
169
  return collsWithOpts.map(([col, opts]) => {
166
- const key = `${col.property.targetMeta.className}|${JSON.stringify(opts ?? {})}`;
170
+ const key = `${col.property.targetMeta.uniqueName}|${JSON.stringify(opts ?? {})}`;
167
171
  const entities = resultsMap.get(key);
168
172
  if (entities == null) {
169
173
  // Should never happen
170
- /* v8 ignore next 3 */
174
+ /* v8 ignore next */
171
175
  throw new Error('Cannot match results');
172
176
  }
173
177
  return entities.filter(DataloaderUtils.getColFilter(col));
@@ -182,7 +186,7 @@ export class DataloaderUtils {
182
186
  return async (collsWithOpts) => {
183
187
  const groups = new Map();
184
188
  for (const [col, opts] of collsWithOpts) {
185
- const key = `${col.property.targetMeta.className}.${col.property.name}|${JSON.stringify(opts ?? {})}`;
189
+ const key = `${col.property.targetMeta.uniqueName}.${col.property.name}|${JSON.stringify(opts ?? {})}`;
186
190
  const value = groups.get(key) ?? [];
187
191
  value.push([col, opts ?? {}]);
188
192
  groups.set(key, value);
@@ -197,17 +201,33 @@ export class DataloaderUtils {
197
201
  const owners = group.map(c => c[0].owner);
198
202
  const $or = [];
199
203
  // a bit of a hack, but we need to prefix the key, since we have only a column name, not a property name
200
- const alias = em.config.getNamingStrategy().aliasName(prop.pivotEntity, 0);
204
+ const alias = em.config.getNamingStrategy().aliasName(Utils.className(prop.pivotEntity), 0);
201
205
  const fk = `${alias}.${Utils.getPrimaryKeyHash(prop.joinColumns)}`;
202
206
  for (const c of group) {
203
207
  $or.push({ $and: [c[1]?.where ?? {}, { [fk]: c[0].owner }] });
204
208
  options.refresh ??= c[1]?.refresh;
205
209
  }
206
210
  options.where = wrap({ $or });
207
- const r = await em.getEntityLoader().findChildrenFromPivotTable(owners, prop, options, orderBy, populate, group[0][1]?.ref);
211
+ const r = await em
212
+ .getEntityLoader()
213
+ .findChildrenFromPivotTable(owners, prop, options, orderBy, populate, group[0][1]?.ref);
208
214
  ret.push(...r);
209
215
  }
210
216
  return ret;
211
217
  };
212
218
  }
219
+ static async getDataLoader() {
220
+ if (this.DataLoader) {
221
+ return this.DataLoader;
222
+ }
223
+ try {
224
+ const mod = await import('dataloader');
225
+ const DataLoader = mod.default;
226
+ return (this.DataLoader ??= DataLoader);
227
+ }
228
+ catch {
229
+ /* v8 ignore next */
230
+ throw new Error("DataLoader is not found, make sure `dataloader` package is installed in your project's dependencies.");
231
+ }
232
+ }
213
233
  }
@@ -1,54 +1,49 @@
1
- import type { EntityData, EntityDictionary, EntityMetadata, EntityProperty, IMetadataStorage } from '../typings.js';
1
+ import type { EntityData, EntityDictionary, EntityMetadata, EntityName, EntityProperty, IMetadataStorage, Primary } from '../typings.js';
2
2
  import type { Platform } from '../platforms/Platform.js';
3
+ import type { Configuration } from './Configuration.js';
3
4
  type Comparator<T> = (a: T, b: T, options?: {
4
5
  includeInverseSides?: boolean;
5
6
  }) => EntityData<T>;
6
7
  type ResultMapper<T> = (result: EntityData<T>) => EntityData<T> | null;
7
8
  type SnapshotGenerator<T> = (entity: T) => EntityData<T>;
9
+ type PkGetter<T> = (entity: T) => Primary<T>;
10
+ type PkSerializer<T> = (entity: T) => string;
8
11
  type CompositeKeyPart = string | CompositeKeyPart[];
9
12
  export declare class EntityComparator {
10
- private readonly metadata;
11
- private readonly platform;
12
- private readonly comparators;
13
- private readonly mappers;
14
- private readonly snapshotGenerators;
15
- private readonly pkGetters;
16
- private readonly pkGettersConverted;
17
- private readonly pkSerializers;
18
- private tmpIndex;
19
- constructor(metadata: IMetadataStorage, platform: Platform);
13
+ #private;
14
+ constructor(metadata: IMetadataStorage, platform: Platform, config?: Configuration);
20
15
  /**
21
16
  * Computes difference between two entities.
22
17
  */
23
- diffEntities<T>(entityName: string, a: EntityData<T>, b: EntityData<T>, options?: {
18
+ diffEntities<T extends object>(entityName: EntityName<T>, a: EntityData<T>, b: EntityData<T>, options?: {
24
19
  includeInverseSides?: boolean;
25
20
  }): EntityData<T>;
26
- matching<T>(entityName: string, a: EntityData<T>, b: EntityData<T>): boolean;
21
+ matching<T extends object>(entityName: EntityName<T>, a: EntityData<T>, b: EntityData<T>): boolean;
27
22
  /**
28
23
  * Removes ORM specific code from entities and prepares it for serializing. Used before change set computation.
29
24
  * References will be mapped to primary keys, collections to arrays of primary keys.
30
25
  */
31
- prepareEntity<T>(entity: T): EntityData<T>;
26
+ prepareEntity<T extends object>(entity: T): EntityData<T>;
32
27
  /**
33
28
  * Maps database columns to properties.
34
29
  */
35
- mapResult<T>(entityName: string, result: EntityDictionary<T>): EntityData<T>;
30
+ mapResult<T>(meta: EntityMetadata<T>, result: EntityDictionary<T>): EntityData<T>;
36
31
  /**
37
32
  * @internal Highly performance-sensitive method.
38
33
  */
39
- getPkGetter<T>(meta: EntityMetadata<T>): any;
34
+ getPkGetter<T>(meta: EntityMetadata<T>): PkGetter<T>;
40
35
  /**
41
36
  * @internal Highly performance-sensitive method.
42
37
  */
43
- getPkGetterConverted<T>(meta: EntityMetadata<T>): any;
38
+ getPkGetterConverted<T>(meta: EntityMetadata<T>): PkGetter<T>;
44
39
  /**
45
40
  * @internal Highly performance-sensitive method.
46
41
  */
47
- getPkSerializer<T>(meta: EntityMetadata<T>): any;
42
+ getPkSerializer<T>(meta: EntityMetadata<T>): PkSerializer<T>;
48
43
  /**
49
44
  * @internal Highly performance-sensitive method.
50
45
  */
51
- getSnapshotGenerator<T>(entityName: string): SnapshotGenerator<T>;
46
+ getSnapshotGenerator<T>(entityName: EntityName<T>): SnapshotGenerator<T>;
52
47
  /**
53
48
  * @internal
54
49
  */
@@ -64,7 +59,7 @@ export declare class EntityComparator {
64
59
  /**
65
60
  * @internal Highly performance-sensitive method.
66
61
  */
67
- getResultMapper<T>(entityName: string): ResultMapper<T>;
62
+ getResultMapper<T>(meta: EntityMetadata<T>): ResultMapper<T>;
68
63
  private getPropertyCondition;
69
64
  private getEmbeddedArrayPropertySnapshot;
70
65
  /**
@@ -78,11 +73,16 @@ export declare class EntityComparator {
78
73
  /**
79
74
  * @internal Highly performance-sensitive method.
80
75
  */
81
- getEntityComparator<T extends object>(entityName: string): Comparator<T>;
76
+ getEntityComparator<T extends object>(entityName: EntityName<T>): Comparator<T>;
82
77
  private getGenericComparator;
83
78
  private getPropertyComparator;
84
79
  private wrap;
85
80
  private safeKey;
81
+ /**
82
+ * Sets the toArray helper in the context if not already set.
83
+ * Used for converting composite PKs to arrays.
84
+ */
85
+ private setToArrayHelper;
86
86
  /**
87
87
  * perf: used to generate list of comparable properties during discovery, so we speed up the runtime comparison
88
88
  */