@mikro-orm/core 7.0.0-rc.3 → 7.0.1-dev.0
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.
- package/EntityManager.d.ts +2 -15
- package/EntityManager.js +155 -152
- package/MikroORM.d.ts +4 -6
- package/MikroORM.js +20 -20
- package/README.md +5 -4
- package/cache/FileCacheAdapter.d.ts +1 -5
- package/cache/FileCacheAdapter.js +22 -22
- package/cache/GeneratedCacheAdapter.d.ts +1 -1
- package/cache/GeneratedCacheAdapter.js +6 -6
- package/cache/MemoryCacheAdapter.d.ts +1 -2
- package/cache/MemoryCacheAdapter.js +8 -8
- package/cache/index.d.ts +1 -1
- package/cache/index.js +0 -1
- package/connections/Connection.d.ts +1 -0
- package/connections/Connection.js +27 -11
- package/drivers/DatabaseDriver.d.ts +0 -2
- package/drivers/DatabaseDriver.js +2 -4
- package/entity/Collection.d.ts +1 -9
- package/entity/Collection.js +95 -105
- package/entity/EntityFactory.d.ts +1 -8
- package/entity/EntityFactory.js +48 -48
- package/entity/EntityLoader.d.ts +1 -3
- package/entity/EntityLoader.js +36 -39
- package/entity/Reference.d.ts +1 -2
- package/entity/Reference.js +11 -11
- package/entity/WrappedEntity.d.ts +4 -2
- package/entity/defineEntity.d.ts +18 -73
- package/enums.d.ts +2 -1
- package/enums.js +1 -0
- package/errors.d.ts +11 -11
- package/errors.js +3 -13
- package/events/EventManager.d.ts +1 -4
- package/events/EventManager.js +25 -22
- package/events/index.d.ts +1 -1
- package/events/index.js +0 -1
- package/exceptions.js +8 -6
- package/hydration/ObjectHydrator.d.ts +1 -2
- package/hydration/ObjectHydrator.js +16 -16
- package/logging/DefaultLogger.js +3 -2
- package/logging/Logger.d.ts +2 -1
- package/logging/colors.js +1 -1
- package/logging/index.d.ts +1 -1
- package/logging/index.js +0 -1
- package/metadata/EntitySchema.d.ts +1 -1
- package/metadata/MetadataDiscovery.d.ts +1 -9
- package/metadata/MetadataDiscovery.js +162 -149
- package/metadata/MetadataStorage.d.ts +1 -5
- package/metadata/MetadataStorage.js +36 -36
- package/metadata/discover-entities.js +1 -1
- package/metadata/index.d.ts +1 -1
- package/metadata/index.js +0 -1
- package/naming-strategy/AbstractNamingStrategy.js +1 -1
- package/naming-strategy/EntityCaseNamingStrategy.js +1 -1
- package/naming-strategy/index.d.ts +1 -1
- package/naming-strategy/index.js +0 -1
- package/package.json +1 -1
- package/platforms/Platform.d.ts +23 -1
- package/platforms/Platform.js +57 -4
- package/serialization/EntitySerializer.js +1 -1
- package/serialization/EntityTransformer.js +4 -1
- package/serialization/SerializationContext.d.ts +4 -8
- package/serialization/SerializationContext.js +20 -15
- package/types/UuidType.d.ts +2 -0
- package/types/UuidType.js +14 -2
- package/types/index.d.ts +2 -1
- package/typings.d.ts +12 -1
- package/unit-of-work/ChangeSetComputer.d.ts +1 -6
- package/unit-of-work/ChangeSetComputer.js +21 -21
- package/unit-of-work/ChangeSetPersister.d.ts +1 -9
- package/unit-of-work/ChangeSetPersister.js +52 -52
- package/unit-of-work/CommitOrderCalculator.d.ts +1 -4
- package/unit-of-work/CommitOrderCalculator.js +13 -13
- package/unit-of-work/IdentityMap.d.ts +2 -5
- package/unit-of-work/IdentityMap.js +18 -18
- package/unit-of-work/UnitOfWork.d.ts +5 -19
- package/unit-of-work/UnitOfWork.js +182 -174
- package/utils/AbstractMigrator.d.ts +1 -1
- package/utils/AbstractMigrator.js +7 -7
- package/utils/Configuration.d.ts +90 -189
- package/utils/Configuration.js +94 -78
- package/utils/Cursor.d.ts +3 -3
- package/utils/Cursor.js +4 -4
- package/utils/EntityComparator.d.ts +8 -15
- package/utils/EntityComparator.js +49 -49
- package/utils/QueryHelper.d.ts +16 -1
- package/utils/QueryHelper.js +70 -24
- package/utils/RawQueryFragment.d.ts +4 -4
- package/utils/TransactionManager.js +1 -2
- package/utils/Utils.d.ts +1 -1
- package/utils/Utils.js +5 -4
- package/utils/clone.js +5 -0
- package/utils/fs-utils.d.ts +3 -17
- package/utils/fs-utils.js +1 -1
- package/utils/upsert-utils.js +1 -1
|
@@ -15,6 +15,7 @@ type MigrateOptions = {
|
|
|
15
15
|
transaction?: Transaction;
|
|
16
16
|
};
|
|
17
17
|
export declare abstract class AbstractMigrator<D extends IDatabaseDriver> implements IMigrator {
|
|
18
|
+
#private;
|
|
18
19
|
protected readonly em: D[typeof EntityManagerType];
|
|
19
20
|
protected runner: IMigrationRunner;
|
|
20
21
|
protected storage: IMigratorStorage;
|
|
@@ -24,7 +25,6 @@ export declare abstract class AbstractMigrator<D extends IDatabaseDriver> implem
|
|
|
24
25
|
protected readonly options: MigrationsOptions;
|
|
25
26
|
protected absolutePath: string;
|
|
26
27
|
protected initialized: boolean;
|
|
27
|
-
private readonly listeners;
|
|
28
28
|
constructor(em: D[typeof EntityManagerType]);
|
|
29
29
|
protected abstract createRunner(): IMigrationRunner;
|
|
30
30
|
protected abstract createStorage(): IMigratorStorage;
|
|
@@ -9,7 +9,7 @@ export class AbstractMigrator {
|
|
|
9
9
|
options;
|
|
10
10
|
absolutePath;
|
|
11
11
|
initialized = false;
|
|
12
|
-
listeners = new Map();
|
|
12
|
+
#listeners = new Map();
|
|
13
13
|
constructor(em) {
|
|
14
14
|
this.em = em;
|
|
15
15
|
this.driver = this.em.getDriver();
|
|
@@ -22,17 +22,17 @@ export class AbstractMigrator {
|
|
|
22
22
|
* @inheritDoc
|
|
23
23
|
*/
|
|
24
24
|
on(eventName, listener) {
|
|
25
|
-
if (!this
|
|
26
|
-
this
|
|
25
|
+
if (!this.#listeners.has(eventName)) {
|
|
26
|
+
this.#listeners.set(eventName, new Set());
|
|
27
27
|
}
|
|
28
|
-
this
|
|
28
|
+
this.#listeners.get(eventName).add(listener);
|
|
29
29
|
return this;
|
|
30
30
|
}
|
|
31
31
|
/**
|
|
32
32
|
* @inheritDoc
|
|
33
33
|
*/
|
|
34
34
|
off(eventName, listener) {
|
|
35
|
-
this
|
|
35
|
+
this.#listeners.get(eventName)?.delete(listener);
|
|
36
36
|
return this;
|
|
37
37
|
}
|
|
38
38
|
/**
|
|
@@ -148,7 +148,7 @@ export class AbstractMigrator {
|
|
|
148
148
|
}
|
|
149
149
|
}
|
|
150
150
|
async emit(event, data) {
|
|
151
|
-
for (const listener of this
|
|
151
|
+
for (const listener of this.#listeners.get(event) ?? []) {
|
|
152
152
|
await listener(data);
|
|
153
153
|
}
|
|
154
154
|
}
|
|
@@ -255,7 +255,7 @@ export class AbstractMigrator {
|
|
|
255
255
|
}
|
|
256
256
|
getMigrationFilename(name) {
|
|
257
257
|
name = name.replace(/\.[jt]s$/, '');
|
|
258
|
-
return
|
|
258
|
+
return /^\d{14}$/.exec(name) ? this.options.fileName(name) : name;
|
|
259
259
|
}
|
|
260
260
|
prefix(options) {
|
|
261
261
|
if (typeof options === 'string' || Array.isArray(options)) {
|