@mikro-orm/core 7.0.0-dev.9 → 7.0.0-dev.91
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 +77 -48
- package/EntityManager.js +288 -225
- package/MikroORM.d.ts +40 -31
- package/MikroORM.js +98 -137
- package/README.md +3 -2
- package/cache/FileCacheAdapter.d.ts +1 -1
- package/cache/FileCacheAdapter.js +6 -5
- package/cache/GeneratedCacheAdapter.d.ts +0 -1
- package/cache/GeneratedCacheAdapter.js +0 -2
- package/cache/index.d.ts +0 -1
- package/cache/index.js +0 -1
- package/connections/Connection.d.ts +11 -7
- package/connections/Connection.js +16 -14
- package/drivers/DatabaseDriver.d.ts +11 -5
- package/drivers/DatabaseDriver.js +23 -11
- package/drivers/IDatabaseDriver.d.ts +25 -4
- package/entity/BaseEntity.d.ts +0 -1
- package/entity/BaseEntity.js +0 -3
- package/entity/Collection.d.ts +95 -30
- package/entity/Collection.js +432 -93
- package/entity/EntityAssigner.d.ts +1 -1
- package/entity/EntityAssigner.js +17 -9
- package/entity/EntityFactory.d.ts +7 -0
- package/entity/EntityFactory.js +63 -41
- package/entity/EntityHelper.js +26 -12
- package/entity/EntityLoader.d.ts +5 -4
- package/entity/EntityLoader.js +63 -38
- package/entity/EntityRepository.d.ts +1 -1
- package/entity/Reference.d.ts +6 -5
- package/entity/Reference.js +34 -9
- package/entity/WrappedEntity.d.ts +2 -7
- package/entity/WrappedEntity.js +2 -7
- package/entity/defineEntity.d.ts +568 -0
- package/entity/defineEntity.js +529 -0
- package/entity/index.d.ts +3 -2
- package/entity/index.js +3 -2
- package/entity/utils.d.ts +7 -0
- package/entity/utils.js +16 -4
- package/entity/validators.d.ts +11 -0
- package/entity/validators.js +65 -0
- package/enums.d.ts +21 -6
- package/enums.js +14 -1
- package/errors.d.ts +10 -2
- package/errors.js +29 -10
- package/events/EventManager.d.ts +2 -1
- package/events/EventManager.js +19 -11
- package/events/EventSubscriber.d.ts +3 -1
- package/hydration/Hydrator.js +1 -2
- package/hydration/ObjectHydrator.d.ts +4 -4
- package/hydration/ObjectHydrator.js +35 -25
- package/index.d.ts +2 -2
- package/index.js +1 -2
- package/logging/DefaultLogger.d.ts +1 -1
- package/logging/DefaultLogger.js +1 -0
- package/logging/SimpleLogger.d.ts +1 -1
- package/logging/index.d.ts +1 -0
- package/logging/index.js +1 -0
- package/logging/inspect.d.ts +2 -0
- package/logging/inspect.js +16 -0
- package/metadata/EntitySchema.d.ts +9 -13
- package/metadata/EntitySchema.js +44 -26
- package/metadata/MetadataDiscovery.d.ts +6 -9
- package/metadata/MetadataDiscovery.js +165 -205
- package/metadata/MetadataProvider.d.ts +11 -2
- package/metadata/MetadataProvider.js +44 -2
- package/metadata/MetadataStorage.d.ts +1 -6
- package/metadata/MetadataStorage.js +6 -18
- package/metadata/MetadataValidator.d.ts +0 -7
- package/metadata/MetadataValidator.js +0 -10
- package/metadata/discover-entities.d.ts +5 -0
- package/metadata/discover-entities.js +40 -0
- package/metadata/index.d.ts +1 -1
- package/metadata/index.js +1 -1
- package/metadata/types.d.ts +480 -0
- package/metadata/types.js +1 -0
- package/naming-strategy/AbstractNamingStrategy.d.ts +5 -1
- package/naming-strategy/AbstractNamingStrategy.js +8 -2
- package/naming-strategy/NamingStrategy.d.ts +11 -1
- package/not-supported.d.ts +2 -0
- package/not-supported.js +4 -0
- package/package.json +18 -10
- package/platforms/ExceptionConverter.js +1 -1
- package/platforms/Platform.d.ts +6 -13
- package/platforms/Platform.js +15 -41
- package/serialization/EntitySerializer.d.ts +2 -0
- package/serialization/EntitySerializer.js +32 -14
- package/serialization/EntityTransformer.js +22 -12
- package/serialization/SerializationContext.js +16 -13
- package/types/ArrayType.d.ts +1 -1
- package/types/ArrayType.js +2 -3
- package/types/BigIntType.d.ts +8 -6
- package/types/BigIntType.js +1 -1
- package/types/BlobType.d.ts +0 -1
- package/types/BlobType.js +0 -3
- package/types/BooleanType.d.ts +2 -1
- package/types/BooleanType.js +3 -0
- package/types/DecimalType.d.ts +6 -4
- package/types/DecimalType.js +3 -3
- package/types/DoubleType.js +2 -2
- package/types/EnumArrayType.js +1 -2
- package/types/JsonType.d.ts +1 -1
- package/types/JsonType.js +7 -2
- package/types/TinyIntType.js +1 -1
- package/types/Type.d.ts +2 -4
- package/types/Type.js +3 -3
- package/types/Uint8ArrayType.d.ts +0 -1
- package/types/Uint8ArrayType.js +1 -4
- package/types/index.d.ts +1 -1
- package/typings.d.ts +109 -73
- package/typings.js +38 -35
- package/unit-of-work/ChangeSet.d.ts +0 -3
- package/unit-of-work/ChangeSet.js +2 -2
- package/unit-of-work/ChangeSetComputer.d.ts +1 -3
- package/unit-of-work/ChangeSetComputer.js +11 -9
- package/unit-of-work/ChangeSetPersister.d.ts +5 -4
- package/unit-of-work/ChangeSetPersister.js +51 -19
- package/unit-of-work/UnitOfWork.d.ts +8 -1
- package/unit-of-work/UnitOfWork.js +91 -49
- package/utils/AbstractSchemaGenerator.d.ts +5 -5
- package/utils/AbstractSchemaGenerator.js +11 -9
- package/utils/Configuration.d.ts +757 -206
- package/utils/Configuration.js +140 -188
- package/utils/ConfigurationLoader.d.ts +1 -54
- package/utils/ConfigurationLoader.js +1 -352
- package/utils/Cursor.d.ts +0 -3
- package/utils/Cursor.js +6 -3
- package/utils/DataloaderUtils.d.ts +15 -5
- package/utils/DataloaderUtils.js +54 -8
- package/utils/EntityComparator.d.ts +8 -4
- package/utils/EntityComparator.js +52 -17
- package/utils/QueryHelper.d.ts +9 -1
- package/utils/QueryHelper.js +70 -9
- package/utils/RawQueryFragment.d.ts +36 -13
- package/utils/RawQueryFragment.js +36 -16
- package/utils/TransactionManager.d.ts +65 -0
- package/utils/TransactionManager.js +223 -0
- package/utils/Utils.d.ts +9 -97
- package/utils/Utils.js +83 -302
- package/utils/clone.js +2 -3
- package/utils/env-vars.d.ts +3 -0
- package/utils/env-vars.js +87 -0
- package/utils/fs-utils.d.ts +12 -0
- package/utils/fs-utils.js +97 -0
- package/utils/index.d.ts +2 -1
- package/utils/index.js +2 -1
- package/utils/upsert-utils.d.ts +7 -2
- package/utils/upsert-utils.js +55 -4
- package/decorators/Check.d.ts +0 -3
- package/decorators/Check.js +0 -13
- package/decorators/CreateRequestContext.d.ts +0 -3
- package/decorators/CreateRequestContext.js +0 -32
- package/decorators/Embeddable.d.ts +0 -8
- package/decorators/Embeddable.js +0 -11
- package/decorators/Embedded.d.ts +0 -18
- package/decorators/Embedded.js +0 -18
- package/decorators/Entity.d.ts +0 -18
- package/decorators/Entity.js +0 -12
- package/decorators/Enum.d.ts +0 -9
- package/decorators/Enum.js +0 -16
- package/decorators/Filter.d.ts +0 -2
- package/decorators/Filter.js +0 -8
- package/decorators/Formula.d.ts +0 -4
- package/decorators/Formula.js +0 -15
- package/decorators/Indexed.d.ts +0 -19
- package/decorators/Indexed.js +0 -20
- package/decorators/ManyToMany.d.ts +0 -40
- package/decorators/ManyToMany.js +0 -14
- package/decorators/ManyToOne.d.ts +0 -30
- package/decorators/ManyToOne.js +0 -14
- package/decorators/OneToMany.d.ts +0 -28
- package/decorators/OneToMany.js +0 -17
- package/decorators/OneToOne.d.ts +0 -24
- package/decorators/OneToOne.js +0 -7
- package/decorators/PrimaryKey.d.ts +0 -8
- package/decorators/PrimaryKey.js +0 -20
- package/decorators/Property.d.ts +0 -250
- package/decorators/Property.js +0 -32
- package/decorators/Transactional.d.ts +0 -13
- package/decorators/Transactional.js +0 -28
- package/decorators/hooks.d.ts +0 -16
- package/decorators/hooks.js +0 -47
- package/decorators/index.d.ts +0 -17
- package/decorators/index.js +0 -17
- package/entity/ArrayCollection.d.ts +0 -116
- package/entity/ArrayCollection.js +0 -402
- package/entity/EntityValidator.d.ts +0 -19
- package/entity/EntityValidator.js +0 -150
- package/metadata/ReflectMetadataProvider.d.ts +0 -8
- package/metadata/ReflectMetadataProvider.js +0 -44
- package/utils/resolveContextProvider.d.ts +0 -10
- package/utils/resolveContextProvider.js +0 -28
package/logging/index.d.ts
CHANGED
package/logging/index.js
CHANGED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
let nodeInspect;
|
|
2
|
+
/** @internal */
|
|
3
|
+
export function inspect(value, options) {
|
|
4
|
+
if (nodeInspect === undefined) {
|
|
5
|
+
/* v8 ignore else */
|
|
6
|
+
if (globalThis.process?.getBuiltinModule) {
|
|
7
|
+
nodeInspect = globalThis.process.getBuiltinModule('node:util').inspect;
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
/* v8 ignore else */
|
|
11
|
+
if (nodeInspect) {
|
|
12
|
+
return nodeInspect(value, options);
|
|
13
|
+
}
|
|
14
|
+
/* v8 ignore next */
|
|
15
|
+
return JSON.stringify(value, null, 2);
|
|
16
|
+
}
|
|
@@ -1,15 +1,7 @@
|
|
|
1
1
|
import { EntityMetadata, type AnyEntity, type EntityKey, type Constructor, type DeepPartial, type EntityName, type EntityProperty, type CleanKeys, type ExpandProperty, type IsNever, type EntityClass } from '../typings.js';
|
|
2
|
-
import type { EmbeddedOptions } from '../decorators/Embedded.js';
|
|
3
|
-
import type { EnumOptions } from '../decorators/Enum.js';
|
|
4
|
-
import type { IndexOptions, UniqueOptions } from '../decorators/Indexed.js';
|
|
5
|
-
import type { ManyToManyOptions } from '../decorators/ManyToMany.js';
|
|
6
|
-
import type { ManyToOneOptions } from '../decorators/ManyToOne.js';
|
|
7
|
-
import type { OneToManyOptions } from '../decorators/OneToMany.js';
|
|
8
|
-
import type { OneToOneOptions } from '../decorators/OneToOne.js';
|
|
9
|
-
import type { PrimaryKeyOptions, SerializedPrimaryKeyOptions } from '../decorators/PrimaryKey.js';
|
|
10
|
-
import type { PropertyOptions } from '../decorators/Property.js';
|
|
11
2
|
import { ReferenceKind } from '../enums.js';
|
|
12
3
|
import { Type } from '../types/Type.js';
|
|
4
|
+
import type { PropertyOptions, ManyToOneOptions, OneToOneOptions, OneToManyOptions, ManyToManyOptions, EmbeddedOptions, EnumOptions, PrimaryKeyOptions, SerializedPrimaryKeyOptions, IndexOptions, UniqueOptions } from './types.js';
|
|
13
5
|
type TypeType = string | NumberConstructor | StringConstructor | BooleanConstructor | DateConstructor | ArrayConstructor | Constructor<Type<any>> | Type<any>;
|
|
14
6
|
type TypeDef<Target> = {
|
|
15
7
|
type: TypeType;
|
|
@@ -31,7 +23,7 @@ export type EntitySchemaProperty<Target, Owner> = ({
|
|
|
31
23
|
kind: ReferenceKind.MANY_TO_MANY | 'm:n';
|
|
32
24
|
} & TypeDef<Target> & ManyToManyOptions<Owner, Target>) | ({
|
|
33
25
|
kind: ReferenceKind.EMBEDDED | 'embedded';
|
|
34
|
-
} & EmbeddedTypeDef<Target> & EmbeddedOptions & PropertyOptions<Owner>) | ({
|
|
26
|
+
} & EmbeddedTypeDef<Target> & EmbeddedOptions<Owner, Target> & PropertyOptions<Owner>) | ({
|
|
35
27
|
enum: true;
|
|
36
28
|
} & EnumOptions<Owner>) | (TypeDef<Target> & PropertyOptions<Owner>);
|
|
37
29
|
type OmitBaseProps<Entity, Base> = IsNever<Base> extends true ? Entity : Omit<Entity, keyof Base>;
|
|
@@ -41,7 +33,7 @@ export type EntitySchemaMetadata<Entity, Base = never> = Omit<Partial<EntityMeta
|
|
|
41
33
|
class: EntityClass<Entity>;
|
|
42
34
|
name?: string;
|
|
43
35
|
}) & {
|
|
44
|
-
extends?:
|
|
36
|
+
extends?: EntityName<Base>;
|
|
45
37
|
} & {
|
|
46
38
|
properties?: {
|
|
47
39
|
[Key in keyof OmitBaseProps<Entity, Base> as CleanKeys<OmitBaseProps<Entity, Base>, Key>]-?: EntitySchemaProperty<ExpandProperty<NonNullable<Entity[Key]>>, Entity>;
|
|
@@ -63,7 +55,7 @@ export declare class EntitySchema<Entity = any, Base = never> {
|
|
|
63
55
|
addVersion(name: EntityKey<Entity>, type: TypeType, options?: PropertyOptions<Entity>): void;
|
|
64
56
|
addPrimaryKey(name: EntityKey<Entity>, type: TypeType, options?: PrimaryKeyOptions<Entity>): void;
|
|
65
57
|
addSerializedPrimaryKey(name: EntityKey<Entity>, type: TypeType, options?: SerializedPrimaryKeyOptions<Entity>): void;
|
|
66
|
-
addEmbedded<Target = AnyEntity>(name: EntityKey<Entity>, options: EmbeddedOptions): void;
|
|
58
|
+
addEmbedded<Target = AnyEntity>(name: EntityKey<Entity>, options: EmbeddedOptions<Entity, Target>): void;
|
|
67
59
|
addManyToOne<Target = AnyEntity>(name: EntityKey<Entity>, type: TypeType, options: ManyToOneOptions<Entity, Target>): void;
|
|
68
60
|
addManyToMany<Target = AnyEntity>(name: EntityKey<Entity>, type: TypeType, options: ManyToManyOptions<Entity, Target>): void;
|
|
69
61
|
addOneToMany<Target = AnyEntity>(name: EntityKey<Entity>, type: TypeType, options: OneToManyOptions<Entity, Target>): void;
|
|
@@ -71,10 +63,12 @@ export declare class EntitySchema<Entity = any, Base = never> {
|
|
|
71
63
|
addIndex<Key extends string>(options: IndexOptions<Entity, Key>): void;
|
|
72
64
|
addUnique<Key extends string>(options: UniqueOptions<Entity, Key>): void;
|
|
73
65
|
setCustomRepository(repository: () => Constructor): void;
|
|
74
|
-
setExtends(base:
|
|
66
|
+
setExtends(base: EntityName<any>): void;
|
|
75
67
|
setClass(proto: EntityClass<Entity>): void;
|
|
76
68
|
get meta(): EntityMetadata<Entity>;
|
|
77
69
|
get name(): EntityName<Entity>;
|
|
70
|
+
get tableName(): string;
|
|
71
|
+
get properties(): Record<string, any>;
|
|
78
72
|
/**
|
|
79
73
|
* @internal
|
|
80
74
|
*/
|
|
@@ -83,5 +77,7 @@ export declare class EntitySchema<Entity = any, Base = never> {
|
|
|
83
77
|
private initPrimaryKeys;
|
|
84
78
|
private normalizeType;
|
|
85
79
|
private createProperty;
|
|
80
|
+
private rename;
|
|
81
|
+
private renameCompositeOptions;
|
|
86
82
|
}
|
|
87
83
|
export {};
|
package/metadata/EntitySchema.js
CHANGED
|
@@ -34,29 +34,13 @@ export class EntitySchema {
|
|
|
34
34
|
return schema;
|
|
35
35
|
}
|
|
36
36
|
addProperty(name, type, options = {}) {
|
|
37
|
-
|
|
38
|
-
if (from in options && !(to in options)) {
|
|
39
|
-
// @ts-ignore
|
|
40
|
-
options[to] = [options[from]];
|
|
41
|
-
// @ts-ignore
|
|
42
|
-
delete options[from];
|
|
43
|
-
}
|
|
44
|
-
};
|
|
45
|
-
if (name !== options.name) {
|
|
46
|
-
Utils.renameKey(options, 'name', 'fieldName');
|
|
47
|
-
}
|
|
48
|
-
rename(options, 'fieldName', 'fieldNames');
|
|
49
|
-
rename(options, 'ref', 'ref');
|
|
50
|
-
rename(options, 'joinColumn', 'joinColumns');
|
|
51
|
-
rename(options, 'inverseJoinColumn', 'inverseJoinColumns');
|
|
52
|
-
rename(options, 'referenceColumnName', 'referencedColumnNames');
|
|
53
|
-
rename(options, 'columnType', 'columnTypes');
|
|
37
|
+
this.renameCompositeOptions(name, options);
|
|
54
38
|
const prop = { name, kind: ReferenceKind.SCALAR, ...options, type: this.normalizeType(options, type) };
|
|
55
39
|
if (type && Type.isMappedType(type.prototype)) {
|
|
56
40
|
prop.type = type;
|
|
57
41
|
}
|
|
58
|
-
if (
|
|
59
|
-
const formula = prop.formula;
|
|
42
|
+
if (typeof prop.formula === 'string') {
|
|
43
|
+
const formula = prop.formula;
|
|
60
44
|
prop.formula = () => formula;
|
|
61
45
|
}
|
|
62
46
|
if (prop.formula) {
|
|
@@ -91,9 +75,10 @@ export class EntitySchema {
|
|
|
91
75
|
}
|
|
92
76
|
addSerializedPrimaryKey(name, type, options = {}) {
|
|
93
77
|
this._meta.serializedPrimaryKey = name;
|
|
94
|
-
this.addProperty(name, type, options);
|
|
78
|
+
this.addProperty(name, type, { serializedPrimaryKey: true, ...options });
|
|
95
79
|
}
|
|
96
80
|
addEmbedded(name, options) {
|
|
81
|
+
this.renameCompositeOptions(name, options);
|
|
97
82
|
Utils.defaultValue(options, 'prefix', true);
|
|
98
83
|
if (options.array) {
|
|
99
84
|
options.object = true; // force object mode for arrays
|
|
@@ -114,6 +99,8 @@ export class EntitySchema {
|
|
|
114
99
|
if (prop.fieldNames && !prop.joinColumns) {
|
|
115
100
|
prop.joinColumns = prop.fieldNames;
|
|
116
101
|
}
|
|
102
|
+
// By default, the foreign key constraint is created on the relation
|
|
103
|
+
Utils.defaultValue(prop, 'createForeignKeyConstraint', true);
|
|
117
104
|
this.addProperty(name, type, prop);
|
|
118
105
|
}
|
|
119
106
|
addManyToMany(name, type, options) {
|
|
@@ -123,6 +110,8 @@ export class EntitySchema {
|
|
|
123
110
|
}
|
|
124
111
|
if (options.owner) {
|
|
125
112
|
Utils.renameKey(options, 'mappedBy', 'inversedBy');
|
|
113
|
+
// By default, the foreign key constraint is created on the relation
|
|
114
|
+
Utils.defaultValue(options, 'createForeignKeyConstraint', true);
|
|
126
115
|
}
|
|
127
116
|
const prop = this.createProperty(ReferenceKind.MANY_TO_MANY, options);
|
|
128
117
|
this.addProperty(name, type, prop);
|
|
@@ -135,8 +124,12 @@ export class EntitySchema {
|
|
|
135
124
|
const prop = this.createProperty(ReferenceKind.ONE_TO_ONE, options);
|
|
136
125
|
Utils.defaultValue(prop, 'owner', !!prop.inversedBy || !prop.mappedBy);
|
|
137
126
|
Utils.defaultValue(prop, 'unique', prop.owner);
|
|
138
|
-
if (prop.owner
|
|
139
|
-
|
|
127
|
+
if (prop.owner) {
|
|
128
|
+
if (options.mappedBy) {
|
|
129
|
+
Utils.renameKey(prop, 'mappedBy', 'inversedBy');
|
|
130
|
+
}
|
|
131
|
+
// By default, the foreign key constraint is created on the relation
|
|
132
|
+
Utils.defaultValue(prop, 'createForeignKeyConstraint', true);
|
|
140
133
|
}
|
|
141
134
|
if (prop.joinColumns && !prop.fieldNames) {
|
|
142
135
|
prop.fieldNames = prop.joinColumns;
|
|
@@ -164,9 +157,7 @@ export class EntitySchema {
|
|
|
164
157
|
this._meta.prototype = proto.prototype;
|
|
165
158
|
this._meta.className = proto.name;
|
|
166
159
|
if (!sameClass || !this._meta.constructorParams) {
|
|
167
|
-
|
|
168
|
-
this._meta.constructorParams = Utils.getParamNames(tokens, 'constructor');
|
|
169
|
-
this._meta.toJsonParams = Utils.getParamNames(tokens, 'toJSON').filter(p => p !== '...args');
|
|
160
|
+
this._meta.constructorParams = Utils.getConstructorParams(proto);
|
|
170
161
|
}
|
|
171
162
|
if (!this.internal) {
|
|
172
163
|
EntitySchema.REGISTRY.set(proto, this);
|
|
@@ -181,6 +172,12 @@ export class EntitySchema {
|
|
|
181
172
|
get name() {
|
|
182
173
|
return this._meta.className;
|
|
183
174
|
}
|
|
175
|
+
get tableName() {
|
|
176
|
+
return this._meta.tableName;
|
|
177
|
+
}
|
|
178
|
+
get properties() {
|
|
179
|
+
return this._meta.properties;
|
|
180
|
+
}
|
|
184
181
|
/**
|
|
185
182
|
* @internal
|
|
186
183
|
*/
|
|
@@ -266,7 +263,7 @@ export class EntitySchema {
|
|
|
266
263
|
}
|
|
267
264
|
normalizeType(options, type) {
|
|
268
265
|
if ('entity' in options) {
|
|
269
|
-
if (
|
|
266
|
+
if (typeof options.entity === 'string') {
|
|
270
267
|
type = options.type = options.entity;
|
|
271
268
|
}
|
|
272
269
|
else if (options.entity) {
|
|
@@ -289,4 +286,25 @@ export class EntitySchema {
|
|
|
289
286
|
...options,
|
|
290
287
|
};
|
|
291
288
|
}
|
|
289
|
+
rename(data, from, to) {
|
|
290
|
+
if (from in data && !(to in data)) {
|
|
291
|
+
// @ts-ignore
|
|
292
|
+
data[to] = [data[from]];
|
|
293
|
+
// @ts-ignore
|
|
294
|
+
delete data[from];
|
|
295
|
+
}
|
|
296
|
+
}
|
|
297
|
+
renameCompositeOptions(name, options = {}) {
|
|
298
|
+
if (name !== options.name && !options.fieldNames) {
|
|
299
|
+
Utils.renameKey(options, 'name', 'fieldName');
|
|
300
|
+
}
|
|
301
|
+
else if (options.name && (options.fieldNames?.length ?? 0) > 1) {
|
|
302
|
+
delete options.name;
|
|
303
|
+
}
|
|
304
|
+
this.rename(options, 'fieldName', 'fieldNames');
|
|
305
|
+
this.rename(options, 'joinColumn', 'joinColumns');
|
|
306
|
+
this.rename(options, 'inverseJoinColumn', 'inverseJoinColumns');
|
|
307
|
+
this.rename(options, 'referenceColumnName', 'referencedColumnNames');
|
|
308
|
+
this.rename(options, 'columnType', 'columnTypes');
|
|
309
|
+
}
|
|
292
310
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type EntityClass, EntityMetadata } from '../typings.js';
|
|
2
2
|
import type { Configuration } from '../utils/Configuration.js';
|
|
3
3
|
import { MetadataStorage } from './MetadataStorage.js';
|
|
4
4
|
import { EntitySchema } from './EntitySchema.js';
|
|
@@ -9,26 +9,25 @@ export declare class MetadataDiscovery {
|
|
|
9
9
|
private readonly config;
|
|
10
10
|
private readonly namingStrategy;
|
|
11
11
|
private readonly metadataProvider;
|
|
12
|
-
private readonly cache;
|
|
13
12
|
private readonly logger;
|
|
14
13
|
private readonly schemaHelper;
|
|
15
14
|
private readonly validator;
|
|
16
15
|
private readonly discovered;
|
|
17
16
|
constructor(metadata: MetadataStorage, platform: Platform, config: Configuration);
|
|
18
17
|
discover(preferTs?: boolean): Promise<MetadataStorage>;
|
|
19
|
-
discoverSync(
|
|
18
|
+
discoverSync(): MetadataStorage;
|
|
19
|
+
validateDiscovered(metadata: EntityMetadata[]): void;
|
|
20
20
|
private mapDiscoveredEntities;
|
|
21
|
+
private initAccessors;
|
|
21
22
|
processDiscoveredEntities(discovered: EntityMetadata[]): EntityMetadata[];
|
|
22
23
|
private findEntities;
|
|
23
24
|
private discoverMissingTargets;
|
|
24
25
|
private tryDiscoverTargets;
|
|
25
|
-
|
|
26
|
-
discoverReferences<T>(refs: (Constructor<T> | EntitySchema<T>)[]): EntityMetadata<T>[];
|
|
26
|
+
discoverReferences<T>(refs: Iterable<EntityClass<T> | EntitySchema<T>>, validate?: boolean): EntityMetadata<T>[];
|
|
27
27
|
reset(className: string): void;
|
|
28
|
-
private prepare;
|
|
29
28
|
private getSchema;
|
|
29
|
+
private getRootEntity;
|
|
30
30
|
private discoverEntity;
|
|
31
|
-
private saveToCache;
|
|
32
31
|
private initNullability;
|
|
33
32
|
private applyNamingStrategy;
|
|
34
33
|
private initOwnColumns;
|
|
@@ -54,7 +53,6 @@ export declare class MetadataDiscovery {
|
|
|
54
53
|
private initAutoincrement;
|
|
55
54
|
private initCheckConstraints;
|
|
56
55
|
private initGeneratedColumn;
|
|
57
|
-
private createColumnMappingObject;
|
|
58
56
|
private getDefaultVersionValue;
|
|
59
57
|
private inferDefaultValue;
|
|
60
58
|
private initDefaultValue;
|
|
@@ -67,6 +65,5 @@ export declare class MetadataDiscovery {
|
|
|
67
65
|
private getPrefix;
|
|
68
66
|
private initUnsigned;
|
|
69
67
|
private initIndexes;
|
|
70
|
-
private getEntityClassOrSchema;
|
|
71
68
|
private shouldForceConstructorUsage;
|
|
72
69
|
}
|