@mikro-orm/core 7.0.0-dev.32 → 7.0.0-dev.321
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 +71 -63
- package/EntityManager.js +365 -283
- package/MikroORM.d.ts +44 -35
- package/MikroORM.js +109 -142
- package/README.md +7 -4
- package/cache/FileCacheAdapter.d.ts +1 -2
- package/cache/FileCacheAdapter.js +19 -14
- package/cache/GeneratedCacheAdapter.d.ts +0 -1
- package/cache/GeneratedCacheAdapter.js +0 -2
- package/cache/index.d.ts +1 -2
- package/cache/index.js +0 -2
- package/connections/Connection.d.ts +12 -5
- package/connections/Connection.js +37 -15
- package/drivers/DatabaseDriver.d.ts +25 -18
- package/drivers/DatabaseDriver.js +144 -45
- package/drivers/IDatabaseDriver.d.ts +118 -23
- package/entity/BaseEntity.d.ts +63 -4
- package/entity/BaseEntity.js +0 -3
- package/entity/Collection.d.ts +101 -29
- package/entity/Collection.js +473 -115
- package/entity/EntityAssigner.js +37 -25
- package/entity/EntityFactory.d.ts +7 -1
- package/entity/EntityFactory.js +116 -64
- package/entity/EntityHelper.d.ts +2 -2
- package/entity/EntityHelper.js +69 -27
- package/entity/EntityLoader.d.ts +11 -10
- package/entity/EntityLoader.js +264 -102
- package/entity/EntityRepository.d.ts +28 -8
- package/entity/EntityRepository.js +8 -2
- package/entity/PolymorphicRef.d.ts +12 -0
- package/entity/PolymorphicRef.js +18 -0
- package/entity/Reference.d.ts +2 -6
- package/entity/Reference.js +52 -19
- package/entity/WrappedEntity.d.ts +3 -8
- package/entity/WrappedEntity.js +6 -7
- package/entity/defineEntity.d.ts +525 -311
- package/entity/defineEntity.js +134 -290
- package/entity/index.d.ts +2 -2
- package/entity/index.js +2 -2
- package/entity/utils.d.ts +6 -1
- package/entity/utils.js +46 -11
- package/entity/validators.d.ts +11 -0
- package/entity/validators.js +66 -0
- package/enums.d.ts +8 -6
- package/enums.js +13 -17
- package/errors.d.ts +20 -10
- package/errors.js +63 -31
- package/events/EventManager.d.ts +2 -1
- package/events/EventManager.js +24 -13
- package/events/index.d.ts +1 -1
- package/events/index.js +0 -1
- package/exceptions.js +9 -2
- package/hydration/Hydrator.js +1 -2
- package/hydration/ObjectHydrator.d.ts +4 -4
- package/hydration/ObjectHydrator.js +105 -46
- package/index.d.ts +2 -2
- package/index.js +1 -2
- package/logging/DefaultLogger.d.ts +1 -1
- package/logging/DefaultLogger.js +3 -4
- package/logging/SimpleLogger.d.ts +1 -1
- package/logging/colors.d.ts +1 -1
- package/logging/colors.js +5 -7
- package/logging/index.d.ts +2 -1
- package/logging/index.js +1 -1
- package/logging/inspect.d.ts +2 -0
- package/logging/inspect.js +11 -0
- package/metadata/EntitySchema.d.ts +47 -23
- package/metadata/EntitySchema.js +103 -34
- package/metadata/MetadataDiscovery.d.ts +64 -9
- package/metadata/MetadataDiscovery.js +867 -354
- package/metadata/MetadataProvider.d.ts +11 -2
- package/metadata/MetadataProvider.js +71 -2
- package/metadata/MetadataStorage.d.ts +13 -11
- package/metadata/MetadataStorage.js +72 -41
- package/metadata/MetadataValidator.d.ts +32 -9
- package/metadata/MetadataValidator.js +214 -44
- 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 +0 -1
- package/metadata/types.d.ts +577 -0
- package/metadata/types.js +1 -0
- package/naming-strategy/AbstractNamingStrategy.d.ts +16 -4
- package/naming-strategy/AbstractNamingStrategy.js +26 -5
- package/naming-strategy/EntityCaseNamingStrategy.d.ts +3 -3
- package/naming-strategy/EntityCaseNamingStrategy.js +6 -5
- package/naming-strategy/MongoNamingStrategy.d.ts +3 -3
- package/naming-strategy/MongoNamingStrategy.js +6 -6
- package/naming-strategy/NamingStrategy.d.ts +28 -4
- package/naming-strategy/UnderscoreNamingStrategy.d.ts +3 -3
- package/naming-strategy/UnderscoreNamingStrategy.js +6 -6
- package/naming-strategy/index.d.ts +1 -1
- package/naming-strategy/index.js +0 -1
- package/not-supported.d.ts +2 -0
- package/not-supported.js +8 -0
- package/package.json +47 -36
- package/platforms/ExceptionConverter.js +1 -1
- package/platforms/Platform.d.ts +33 -15
- package/platforms/Platform.js +125 -69
- package/serialization/EntitySerializer.d.ts +6 -3
- package/serialization/EntitySerializer.js +53 -29
- package/serialization/EntityTransformer.js +33 -21
- package/serialization/SerializationContext.d.ts +6 -6
- package/serialization/SerializationContext.js +4 -4
- package/types/ArrayType.d.ts +1 -1
- package/types/ArrayType.js +2 -3
- package/types/BigIntType.js +1 -1
- package/types/BlobType.d.ts +0 -1
- package/types/BlobType.js +0 -3
- package/types/BooleanType.d.ts +1 -0
- package/types/BooleanType.js +3 -0
- package/types/DecimalType.js +2 -2
- package/types/DoubleType.js +1 -1
- 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/UuidType.d.ts +2 -0
- package/types/UuidType.js +14 -2
- package/types/index.d.ts +3 -2
- package/typings.d.ts +427 -170
- package/typings.js +100 -45
- package/unit-of-work/ChangeSet.d.ts +4 -6
- package/unit-of-work/ChangeSet.js +8 -9
- package/unit-of-work/ChangeSetComputer.d.ts +3 -8
- package/unit-of-work/ChangeSetComputer.js +49 -26
- package/unit-of-work/ChangeSetPersister.d.ts +13 -12
- package/unit-of-work/ChangeSetPersister.js +107 -44
- package/unit-of-work/CommitOrderCalculator.d.ts +12 -10
- package/unit-of-work/CommitOrderCalculator.js +17 -15
- package/unit-of-work/IdentityMap.d.ts +12 -0
- package/unit-of-work/IdentityMap.js +39 -1
- package/unit-of-work/UnitOfWork.d.ts +34 -4
- package/unit-of-work/UnitOfWork.js +294 -107
- package/utils/AbstractMigrator.d.ts +101 -0
- package/utils/AbstractMigrator.js +303 -0
- package/utils/AbstractSchemaGenerator.d.ts +5 -5
- package/utils/AbstractSchemaGenerator.js +30 -18
- package/utils/AsyncContext.d.ts +6 -0
- package/utils/AsyncContext.js +42 -0
- package/utils/Configuration.d.ts +796 -211
- package/utils/Configuration.js +160 -197
- package/utils/ConfigurationLoader.d.ts +1 -52
- package/utils/ConfigurationLoader.js +1 -330
- package/utils/Cursor.d.ts +0 -3
- package/utils/Cursor.js +29 -14
- package/utils/DataloaderUtils.d.ts +10 -5
- package/utils/DataloaderUtils.js +42 -22
- package/utils/EntityComparator.d.ts +16 -9
- package/utils/EntityComparator.js +202 -96
- package/utils/QueryHelper.d.ts +34 -7
- package/utils/QueryHelper.js +183 -72
- package/utils/RawQueryFragment.d.ts +28 -34
- package/utils/RawQueryFragment.js +37 -72
- package/utils/RequestContext.js +2 -2
- package/utils/TransactionContext.js +2 -2
- package/utils/TransactionManager.js +11 -7
- package/utils/Utils.d.ts +16 -127
- package/utils/Utils.js +106 -401
- package/utils/clone.js +13 -23
- package/utils/env-vars.d.ts +7 -0
- package/utils/env-vars.js +98 -0
- package/utils/fs-utils.d.ts +34 -0
- package/utils/fs-utils.js +193 -0
- package/utils/index.d.ts +1 -3
- package/utils/index.js +1 -3
- package/utils/upsert-utils.d.ts +9 -4
- package/utils/upsert-utils.js +51 -5
- 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 -12
- package/decorators/Embedded.js +0 -18
- package/decorators/Entity.d.ts +0 -33
- 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 -42
- package/decorators/ManyToMany.js +0 -14
- package/decorators/ManyToOne.d.ts +0 -34
- 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 -28
- 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 -14
- 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 -118
- package/entity/ArrayCollection.js +0 -407
- 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
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ConnectionType, EntityData, EntityMetadata, EntityProperty, FilterQuery, Primary, Dictionary,
|
|
1
|
+
import type { ConnectionType, Constructor, EntityData, EntityMetadata, EntityProperty, FilterQuery, Primary, Dictionary, IPrimaryKey, PopulateOptions, EntityDictionary, AutoPath, ObjectQuery, FilterObject, Populate, EntityName, PopulateHintOptions, Prefixes } from '../typings.js';
|
|
2
2
|
import type { Connection, QueryResult, Transaction } from '../connections/Connection.js';
|
|
3
3
|
import type { FlushMode, LockMode, QueryOrderMap, QueryFlag, LoadStrategy, PopulateHint, PopulatePath } from '../enums.js';
|
|
4
4
|
import type { Platform } from '../platforms/Platform.js';
|
|
@@ -7,34 +7,40 @@ import type { Collection } from '../entity/Collection.js';
|
|
|
7
7
|
import type { EntityManager } from '../EntityManager.js';
|
|
8
8
|
import type { DriverException } from '../exceptions.js';
|
|
9
9
|
import type { Configuration } from '../utils/Configuration.js';
|
|
10
|
+
import type { MikroORM } from '../MikroORM.js';
|
|
10
11
|
import type { LoggingOptions, LogContext } from '../logging/Logger.js';
|
|
11
|
-
import type {
|
|
12
|
+
import type { Raw } from '../utils/RawQueryFragment.js';
|
|
12
13
|
export declare const EntityManagerType: unique symbol;
|
|
13
14
|
export interface IDatabaseDriver<C extends Connection = Connection> {
|
|
14
15
|
[EntityManagerType]: EntityManager<this>;
|
|
15
16
|
readonly config: Configuration;
|
|
16
17
|
createEntityManager(useContext?: boolean): this[typeof EntityManagerType];
|
|
17
|
-
connect(
|
|
18
|
+
connect(options?: {
|
|
19
|
+
skipOnConnect?: boolean;
|
|
20
|
+
}): Promise<C>;
|
|
18
21
|
close(force?: boolean): Promise<void>;
|
|
19
|
-
reconnect(
|
|
22
|
+
reconnect(options?: {
|
|
23
|
+
skipOnConnect?: boolean;
|
|
24
|
+
}): Promise<C>;
|
|
20
25
|
getConnection(type?: ConnectionType): C;
|
|
21
26
|
/**
|
|
22
27
|
* Finds selection of entities
|
|
23
28
|
*/
|
|
24
|
-
find<T extends object, P extends string = never, F extends string = '*', E extends string = never>(entityName:
|
|
29
|
+
find<T extends object, P extends string = never, F extends string = '*', E extends string = never>(entityName: EntityName<T>, where: FilterQuery<T>, options?: FindOptions<T, P, F, E>): Promise<EntityData<T>[]>;
|
|
25
30
|
/**
|
|
26
31
|
* Finds single entity (table row, document)
|
|
27
32
|
*/
|
|
28
|
-
findOne<T extends object, P extends string = never, F extends string = '*', E extends string = never>(entityName:
|
|
29
|
-
findVirtual<T extends object>(entityName:
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
33
|
+
findOne<T extends object, P extends string = never, F extends string = '*', E extends string = never>(entityName: EntityName<T>, where: FilterQuery<T>, options?: FindOneOptions<T, P, F, E>): Promise<EntityData<T> | null>;
|
|
34
|
+
findVirtual<T extends object>(entityName: EntityName<T>, where: FilterQuery<T>, options: FindOptions<T, any, any, any>): Promise<EntityData<T>[]>;
|
|
35
|
+
stream<T extends object>(entityName: EntityName<T>, where: FilterQuery<T>, options: StreamOptions<T>): AsyncIterableIterator<T>;
|
|
36
|
+
nativeInsert<T extends object>(entityName: EntityName<T>, data: EntityDictionary<T>, options?: NativeInsertUpdateOptions<T>): Promise<QueryResult<T>>;
|
|
37
|
+
nativeInsertMany<T extends object>(entityName: EntityName<T>, data: EntityDictionary<T>[], options?: NativeInsertUpdateManyOptions<T>, transform?: (sql: string) => string): Promise<QueryResult<T>>;
|
|
38
|
+
nativeUpdate<T extends object>(entityName: EntityName<T>, where: FilterQuery<T>, data: EntityDictionary<T>, options?: NativeInsertUpdateOptions<T>): Promise<QueryResult<T>>;
|
|
39
|
+
nativeUpdateMany<T extends object>(entityName: EntityName<T>, where: FilterQuery<T>[], data: EntityDictionary<T>[], options?: NativeInsertUpdateManyOptions<T>): Promise<QueryResult<T>>;
|
|
40
|
+
nativeDelete<T extends object>(entityName: EntityName<T>, where: FilterQuery<T>, options?: NativeDeleteOptions<T>): Promise<QueryResult<T>>;
|
|
35
41
|
syncCollections<T extends object, O extends object>(collections: Iterable<Collection<T, O>>, options?: DriverMethodOptions): Promise<void>;
|
|
36
|
-
count<T extends object, P extends string = never>(entityName:
|
|
37
|
-
aggregate(entityName:
|
|
42
|
+
count<T extends object, P extends string = never>(entityName: EntityName<T>, where: FilterQuery<T>, options?: CountOptions<T, P>): Promise<number>;
|
|
43
|
+
aggregate(entityName: EntityName, pipeline: any[]): Promise<any[]>;
|
|
38
44
|
mapResult<T extends object>(result: EntityDictionary<T>, meta: EntityMetadata<T>, populate?: PopulateOptions<T>[]): EntityData<T> | null;
|
|
39
45
|
/**
|
|
40
46
|
* When driver uses pivot tables for M:N, this method will load identifiers for given collections from them
|
|
@@ -60,6 +66,10 @@ export interface IDatabaseDriver<C extends Connection = Connection> {
|
|
|
60
66
|
schema?: string;
|
|
61
67
|
parentSchema?: string;
|
|
62
68
|
}): string | undefined;
|
|
69
|
+
/**
|
|
70
|
+
* @internal
|
|
71
|
+
*/
|
|
72
|
+
getORMClass(): Constructor<MikroORM>;
|
|
63
73
|
}
|
|
64
74
|
export type EntityField<T, P extends string = PopulatePath.ALL> = keyof T | PopulatePath.ALL | AutoPath<T, P, `${PopulatePath.ALL}`>;
|
|
65
75
|
export type OrderDefinition<T> = (QueryOrderMap<T> & {
|
|
@@ -68,6 +78,18 @@ export type OrderDefinition<T> = (QueryOrderMap<T> & {
|
|
|
68
78
|
export interface FindAllOptions<T, P extends string = never, F extends string = '*', E extends string = never> extends FindOptions<T, P, F, E> {
|
|
69
79
|
where?: FilterQuery<T>;
|
|
70
80
|
}
|
|
81
|
+
export interface StreamOptions<Entity, Populate extends string = never, Fields extends string = '*', Exclude extends string = never> extends Omit<FindAllOptions<Entity, Populate, Fields, Exclude>, 'cache' | 'before' | 'after' | 'first' | 'last' | 'overfetch' | 'strategy'> {
|
|
82
|
+
/**
|
|
83
|
+
* When populating to-many relations, the ORM streams fully merged entities instead of yielding every row.
|
|
84
|
+
* You can opt out of this behavior by specifying `mergeResults: false`. This will yield every row from
|
|
85
|
+
* the SQL result, but still mapped to entities, meaning that to-many collections will contain at most
|
|
86
|
+
* a single item, and you will get duplicate root entities when they have multiple items in the populated
|
|
87
|
+
* collection.
|
|
88
|
+
*
|
|
89
|
+
* @default true
|
|
90
|
+
*/
|
|
91
|
+
mergeResults?: boolean;
|
|
92
|
+
}
|
|
71
93
|
export type FilterOptions = Dictionary<boolean | Dictionary> | string[] | boolean;
|
|
72
94
|
export interface LoadHint<Entity, Hint extends string = never, Fields extends string = PopulatePath.ALL, Excludes extends string = never> {
|
|
73
95
|
populate?: Populate<Entity, Hint>;
|
|
@@ -88,8 +110,28 @@ export interface FindOptions<Entity, Hint extends string = never, Fields extends
|
|
|
88
110
|
* when nesting the condition. This is used for implementation of joined filters.
|
|
89
111
|
*/
|
|
90
112
|
populateFilter?: ObjectQuery<Entity>;
|
|
113
|
+
/**
|
|
114
|
+
* Index-friendly alternative to `$or` for conditions that span joined relations.
|
|
115
|
+
* Each array element becomes an independent branch combined via `UNION ALL` subquery:
|
|
116
|
+
* `WHERE pk IN (branch_1 UNION ALL branch_2 ... branch_N)`.
|
|
117
|
+
* The database plans each branch independently, enabling per-table index usage
|
|
118
|
+
* (e.g. GIN trigram indexes for fuzzy search across related entities).
|
|
119
|
+
* sql only
|
|
120
|
+
*/
|
|
121
|
+
unionWhere?: ObjectQuery<Entity>[];
|
|
122
|
+
/**
|
|
123
|
+
* Strategy for combining `unionWhere` branches.
|
|
124
|
+
* - `'union-all'` (default) — skips deduplication, faster for most use cases.
|
|
125
|
+
* - `'union'` — deduplicates rows between branches; useful when branch overlap is very high.
|
|
126
|
+
* sql only
|
|
127
|
+
*/
|
|
128
|
+
unionWhereStrategy?: 'union-all' | 'union';
|
|
91
129
|
/** Used for ordering of the populate queries. If not specified, the value of `options.orderBy` is used. */
|
|
92
130
|
populateOrderBy?: OrderDefinition<Entity>;
|
|
131
|
+
/** Per-relation overrides for populate loading behavior. Keys are populate paths (same as used in `populate`). */
|
|
132
|
+
populateHints?: [Hint] extends [never] ? never : {
|
|
133
|
+
[K in Prefixes<Hint>]?: PopulateHintOptions;
|
|
134
|
+
};
|
|
93
135
|
/** Ordering of the results.Can be an object or array of objects, keys are property names, values are ordering (asc/desc) */
|
|
94
136
|
orderBy?: OrderDefinition<Entity>;
|
|
95
137
|
/** Control result caching for this query. Result cache is by default disabled, not to be confused with the identity map. */
|
|
@@ -127,7 +169,7 @@ export interface FindOptions<Entity, Hint extends string = never, Fields extends
|
|
|
127
169
|
flags?: QueryFlag[];
|
|
128
170
|
/** sql only */
|
|
129
171
|
groupBy?: string | string[];
|
|
130
|
-
having?:
|
|
172
|
+
having?: FilterQuery<Entity>;
|
|
131
173
|
/** sql only */
|
|
132
174
|
strategy?: LoadStrategy | `${LoadStrategy}`;
|
|
133
175
|
flushMode?: FlushMode | `${FlushMode}`;
|
|
@@ -138,21 +180,27 @@ export interface FindOptions<Entity, Hint extends string = never, Fields extends
|
|
|
138
180
|
lockTableAliases?: string[];
|
|
139
181
|
ctx?: Transaction;
|
|
140
182
|
connectionType?: ConnectionType;
|
|
141
|
-
/**
|
|
142
|
-
indexHint?: string;
|
|
183
|
+
/** SQL: appended to FROM clause (e.g. `'force index(my_index)'`); MongoDB: index name or spec passed as `hint`. */
|
|
184
|
+
indexHint?: string | Dictionary;
|
|
143
185
|
/** sql only */
|
|
144
186
|
comments?: string | string[];
|
|
145
187
|
/** sql only */
|
|
146
188
|
hintComments?: string | string[];
|
|
189
|
+
/** SQL: collation name string applied as COLLATE to ORDER BY; MongoDB: CollationOptions object. */
|
|
190
|
+
collation?: CollationOptions | string;
|
|
191
|
+
/** mongodb only */
|
|
192
|
+
maxTimeMS?: number;
|
|
193
|
+
/** mongodb only */
|
|
194
|
+
allowDiskUse?: boolean;
|
|
147
195
|
loggerContext?: LogContext;
|
|
148
196
|
logging?: LoggingOptions;
|
|
149
197
|
/** @internal used to apply filters to the auto-joined relations */
|
|
150
198
|
em?: EntityManager;
|
|
151
199
|
}
|
|
152
|
-
export interface FindByCursorOptions<T extends object, P extends string = never, F extends string = '*', E extends string = never, I extends boolean = true> extends Omit<
|
|
200
|
+
export interface FindByCursorOptions<T extends object, P extends string = never, F extends string = '*', E extends string = never, I extends boolean = true> extends Omit<FindAllOptions<T, P, F, E>, 'limit' | 'offset'> {
|
|
153
201
|
includeCount?: I;
|
|
154
202
|
}
|
|
155
|
-
export interface FindOneOptions<T
|
|
203
|
+
export interface FindOneOptions<T, P extends string = never, F extends string = '*', E extends string = never> extends Omit<FindOptions<T, P, F, E>, 'limit' | 'lockMode'> {
|
|
156
204
|
lockMode?: LockMode;
|
|
157
205
|
lockVersion?: number | Date;
|
|
158
206
|
}
|
|
@@ -167,15 +215,23 @@ export interface NativeInsertUpdateOptions<T> {
|
|
|
167
215
|
/** `nativeUpdate()` only option */
|
|
168
216
|
upsert?: boolean;
|
|
169
217
|
loggerContext?: LogContext;
|
|
218
|
+
/** sql only */
|
|
219
|
+
unionWhere?: ObjectQuery<T>[];
|
|
220
|
+
/** sql only */
|
|
221
|
+
unionWhereStrategy?: 'union-all' | 'union';
|
|
222
|
+
filters?: FilterOptions;
|
|
223
|
+
/** @internal */
|
|
224
|
+
em?: EntityManager;
|
|
170
225
|
}
|
|
171
226
|
export interface NativeInsertUpdateManyOptions<T> extends NativeInsertUpdateOptions<T> {
|
|
172
227
|
processCollections?: boolean;
|
|
173
228
|
}
|
|
174
229
|
export interface UpsertOptions<Entity, Fields extends string = never> extends Omit<NativeInsertUpdateOptions<Entity>, 'upsert'> {
|
|
175
|
-
onConflictFields?: (keyof Entity)[] |
|
|
230
|
+
onConflictFields?: (keyof Entity)[] | Raw;
|
|
176
231
|
onConflictAction?: 'ignore' | 'merge';
|
|
177
232
|
onConflictMergeFields?: AutoPath<Entity, Fields, `${PopulatePath.ALL}`>[];
|
|
178
233
|
onConflictExcludeFields?: AutoPath<Entity, Fields, `${PopulatePath.ALL}`>[];
|
|
234
|
+
onConflictWhere?: FilterQuery<Entity>;
|
|
179
235
|
disableIdentityMap?: boolean;
|
|
180
236
|
}
|
|
181
237
|
export interface UpsertManyOptions<Entity, Fields extends string = never> extends UpsertOptions<Entity, Fields> {
|
|
@@ -185,20 +241,28 @@ export interface CountOptions<T extends object, P extends string = never> {
|
|
|
185
241
|
filters?: FilterOptions;
|
|
186
242
|
schema?: string;
|
|
187
243
|
groupBy?: string | readonly string[];
|
|
188
|
-
having?:
|
|
244
|
+
having?: FilterQuery<T>;
|
|
189
245
|
cache?: boolean | number | [string, number];
|
|
190
246
|
populate?: Populate<T, P>;
|
|
191
247
|
populateWhere?: ObjectQuery<T> | PopulateHint | `${PopulateHint}`;
|
|
192
248
|
populateFilter?: ObjectQuery<T>;
|
|
249
|
+
/** @see FindOptions.unionWhere */
|
|
250
|
+
unionWhere?: ObjectQuery<T>[];
|
|
251
|
+
/** @see FindOptions.unionWhereStrategy */
|
|
252
|
+
unionWhereStrategy?: 'union-all' | 'union';
|
|
193
253
|
ctx?: Transaction;
|
|
194
254
|
connectionType?: ConnectionType;
|
|
195
255
|
flushMode?: FlushMode | `${FlushMode}`;
|
|
196
|
-
/**
|
|
197
|
-
indexHint?: string;
|
|
256
|
+
/** SQL: appended to FROM clause (e.g. `'force index(my_index)'`); MongoDB: index name or spec passed as `hint`. */
|
|
257
|
+
indexHint?: string | Dictionary;
|
|
198
258
|
/** sql only */
|
|
199
259
|
comments?: string | string[];
|
|
200
260
|
/** sql only */
|
|
201
261
|
hintComments?: string | string[];
|
|
262
|
+
/** SQL: collation name string applied as COLLATE; MongoDB: CollationOptions object. */
|
|
263
|
+
collation?: CollationOptions | string;
|
|
264
|
+
/** mongodb only */
|
|
265
|
+
maxTimeMS?: number;
|
|
202
266
|
loggerContext?: LogContext;
|
|
203
267
|
logging?: LoggingOptions;
|
|
204
268
|
/** @internal used to apply filters to the auto-joined relations */
|
|
@@ -208,12 +272,28 @@ export interface UpdateOptions<T> {
|
|
|
208
272
|
filters?: FilterOptions;
|
|
209
273
|
schema?: string;
|
|
210
274
|
ctx?: Transaction;
|
|
275
|
+
/** sql only */
|
|
276
|
+
unionWhere?: ObjectQuery<T>[];
|
|
277
|
+
/** sql only */
|
|
278
|
+
unionWhereStrategy?: 'union-all' | 'union';
|
|
211
279
|
}
|
|
212
280
|
export interface DeleteOptions<T> extends DriverMethodOptions {
|
|
213
281
|
filters?: FilterOptions;
|
|
282
|
+
/** sql only */
|
|
283
|
+
unionWhere?: ObjectQuery<T>[];
|
|
284
|
+
/** sql only */
|
|
285
|
+
unionWhereStrategy?: 'union-all' | 'union';
|
|
286
|
+
/** @internal */
|
|
287
|
+
em?: EntityManager;
|
|
214
288
|
}
|
|
215
289
|
export interface NativeDeleteOptions<T> extends DriverMethodOptions {
|
|
216
290
|
filters?: FilterOptions;
|
|
291
|
+
/** sql only */
|
|
292
|
+
unionWhere?: ObjectQuery<T>[];
|
|
293
|
+
/** sql only */
|
|
294
|
+
unionWhereStrategy?: 'union-all' | 'union';
|
|
295
|
+
/** @internal */
|
|
296
|
+
em?: EntityManager;
|
|
217
297
|
}
|
|
218
298
|
export interface LockOptions extends DriverMethodOptions {
|
|
219
299
|
lockMode?: LockMode;
|
|
@@ -226,8 +306,23 @@ export interface DriverMethodOptions {
|
|
|
226
306
|
schema?: string;
|
|
227
307
|
loggerContext?: LogContext;
|
|
228
308
|
}
|
|
309
|
+
export interface CollationOptions {
|
|
310
|
+
locale: string;
|
|
311
|
+
caseLevel?: boolean;
|
|
312
|
+
caseFirst?: string;
|
|
313
|
+
strength?: number;
|
|
314
|
+
numericOrdering?: boolean;
|
|
315
|
+
alternate?: string;
|
|
316
|
+
maxVariable?: string;
|
|
317
|
+
backwards?: boolean;
|
|
318
|
+
}
|
|
229
319
|
export interface GetReferenceOptions {
|
|
230
320
|
wrapped?: boolean;
|
|
231
321
|
convertCustomTypes?: boolean;
|
|
232
322
|
schema?: string;
|
|
323
|
+
/**
|
|
324
|
+
* Property name to use for identity map lookup instead of the primary key.
|
|
325
|
+
* This is useful for creating references by unique non-PK properties.
|
|
326
|
+
*/
|
|
327
|
+
key?: string;
|
|
233
328
|
}
|
package/entity/BaseEntity.d.ts
CHANGED
|
@@ -1,20 +1,79 @@
|
|
|
1
1
|
import { type Ref } from './Reference.js';
|
|
2
|
-
import type { AutoPath, EntityData, EntityDTO, Loaded, LoadedReference, AddEager, EntityKey, FromEntityType, IsSubset, MergeSelected } from '../typings.js';
|
|
2
|
+
import type { AutoPath, EntityData, EntityDTO, Loaded, LoadedReference, AddEager, EntityKey, FromEntityType, IsSubset, MergeSelected, SerializeDTO } from '../typings.js';
|
|
3
3
|
import { type AssignOptions } from './EntityAssigner.js';
|
|
4
4
|
import type { EntityLoaderOptions } from './EntityLoader.js';
|
|
5
5
|
import { type SerializeOptions } from '../serialization/EntitySerializer.js';
|
|
6
6
|
import type { FindOneOptions } from '../drivers/IDatabaseDriver.js';
|
|
7
|
+
import type { PopulatePath } from '../enums.js';
|
|
7
8
|
export declare abstract class BaseEntity {
|
|
8
9
|
isInitialized(): boolean;
|
|
9
|
-
isTouched(): boolean;
|
|
10
10
|
populated(populated?: boolean): void;
|
|
11
|
-
populate<Entity extends this = this, Hint extends string = never>(populate: AutoPath<Entity, Hint>[] | false, options?: EntityLoaderOptions<Entity>): Promise<Loaded<Entity, Hint>>;
|
|
11
|
+
populate<Entity extends this = this, Hint extends string = never, Fields extends string = never>(populate: AutoPath<Entity, Hint, PopulatePath.ALL>[] | false, options?: EntityLoaderOptions<Entity, Fields>): Promise<Loaded<Entity, Hint>>;
|
|
12
12
|
toReference<Entity extends this = this>(): Ref<Entity> & LoadedReference<Loaded<Entity, AddEager<Entity>>>;
|
|
13
|
+
/**
|
|
14
|
+
* Converts the entity to a plain object representation.
|
|
15
|
+
*
|
|
16
|
+
* **Note on typing with `Loaded` entities:** When called on a `Loaded<Entity, 'relation'>` type,
|
|
17
|
+
* the return type will be `EntityDTO<Entity>` (with relations as primary keys), not
|
|
18
|
+
* `EntityDTO<Loaded<Entity, 'relation'>>` (with loaded relations as nested objects).
|
|
19
|
+
* This is a TypeScript limitation - the `this` type resolves to the class, not the `Loaded` wrapper.
|
|
20
|
+
*
|
|
21
|
+
* For correct typing that reflects loaded relations, use `wrap()`:
|
|
22
|
+
* ```ts
|
|
23
|
+
* const result = await em.find(User, {}, { populate: ['profile'] });
|
|
24
|
+
* // Type: EntityDTO<User> (profile is number)
|
|
25
|
+
* const obj1 = result[0].toObject();
|
|
26
|
+
* // Type: EntityDTO<Loaded<User, 'profile'>> (profile is nested object)
|
|
27
|
+
* const obj2 = wrap(result[0]).toObject();
|
|
28
|
+
* ```
|
|
29
|
+
*
|
|
30
|
+
* Runtime values are correct in both cases - only the static types differ.
|
|
31
|
+
*/
|
|
13
32
|
toObject<Entity extends this = this>(): EntityDTO<Entity>;
|
|
33
|
+
/**
|
|
34
|
+
* Converts the entity to a plain object representation.
|
|
35
|
+
*
|
|
36
|
+
* **Note on typing with `Loaded` entities:** When called on a `Loaded<Entity, 'relation'>` type,
|
|
37
|
+
* the return type will be `EntityDTO<Entity>` (with relations as primary keys), not
|
|
38
|
+
* `EntityDTO<Loaded<Entity, 'relation'>>` (with loaded relations as nested objects).
|
|
39
|
+
* This is a TypeScript limitation - the `this` type resolves to the class, not the `Loaded` wrapper.
|
|
40
|
+
*
|
|
41
|
+
* For correct typing that reflects loaded relations, use `wrap()`:
|
|
42
|
+
* ```ts
|
|
43
|
+
* const result = await em.find(User, {}, { populate: ['profile'] });
|
|
44
|
+
* // Type: EntityDTO<User> (profile is number)
|
|
45
|
+
* const obj1 = result[0].toObject();
|
|
46
|
+
* // Type: EntityDTO<Loaded<User, 'profile'>> (profile is nested object)
|
|
47
|
+
* const obj2 = wrap(result[0]).toObject();
|
|
48
|
+
* ```
|
|
49
|
+
*
|
|
50
|
+
* Runtime values are correct in both cases - only the static types differ.
|
|
51
|
+
*/
|
|
14
52
|
toObject<Entity extends this = this>(ignoreFields: never[]): EntityDTO<Entity>;
|
|
53
|
+
/**
|
|
54
|
+
* Converts the entity to a plain object representation.
|
|
55
|
+
*
|
|
56
|
+
* **Note on typing with `Loaded` entities:** When called on a `Loaded<Entity, 'relation'>` type,
|
|
57
|
+
* the return type will be `EntityDTO<Entity>` (with relations as primary keys), not
|
|
58
|
+
* `EntityDTO<Loaded<Entity, 'relation'>>` (with loaded relations as nested objects).
|
|
59
|
+
* This is a TypeScript limitation - the `this` type resolves to the class, not the `Loaded` wrapper.
|
|
60
|
+
*
|
|
61
|
+
* For correct typing that reflects loaded relations, use `wrap()`:
|
|
62
|
+
* ```ts
|
|
63
|
+
* const result = await em.find(User, {}, { populate: ['profile'] });
|
|
64
|
+
* // Type: EntityDTO<User> (profile is number)
|
|
65
|
+
* const obj1 = result[0].toObject();
|
|
66
|
+
* // Type: EntityDTO<Loaded<User, 'profile'>> (profile is nested object)
|
|
67
|
+
* const obj2 = wrap(result[0]).toObject();
|
|
68
|
+
* ```
|
|
69
|
+
*
|
|
70
|
+
* Runtime values are correct in both cases - only the static types differ.
|
|
71
|
+
*
|
|
72
|
+
* @param ignoreFields - Array of field names to omit from the result.
|
|
73
|
+
*/
|
|
15
74
|
toObject<Entity extends this = this, Ignored extends EntityKey<Entity> = never>(ignoreFields: Ignored[]): Omit<EntityDTO<Entity>, Ignored>;
|
|
16
75
|
toPOJO<Entity extends this = this>(): EntityDTO<Entity>;
|
|
17
|
-
serialize<Entity extends this = this, Naked extends FromEntityType<Entity> = FromEntityType<Entity>, Hint extends string = never, Exclude extends string = never>(options?: SerializeOptions<Naked, Hint, Exclude>):
|
|
76
|
+
serialize<Entity extends this = this, Naked extends FromEntityType<Entity> = FromEntityType<Entity>, Hint extends string = never, Exclude extends string = never>(options?: SerializeOptions<Naked, Hint, Exclude>): SerializeDTO<Naked, Hint, Exclude>;
|
|
18
77
|
assign<Entity extends this, Naked extends FromEntityType<Entity> = FromEntityType<Entity>, Convert extends boolean = false, Data extends EntityData<Naked, Convert> | Partial<EntityDTO<Naked>> = EntityData<Naked, Convert> | Partial<EntityDTO<Naked>>>(data: Data & IsSubset<EntityData<Naked>, Data>, options?: AssignOptions<Convert>): MergeSelected<Entity, Naked, keyof Data & string>;
|
|
19
78
|
init<Entity extends this = this, Hint extends string = never, Fields extends string = '*', Excludes extends string = never>(options?: FindOneOptions<Entity, Hint, Fields, Excludes>): Promise<Loaded<Entity, Hint, Fields, Excludes> | null>;
|
|
20
79
|
getSchema(): string | undefined;
|
package/entity/BaseEntity.js
CHANGED
package/entity/Collection.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import type { EntityDTO, EntityKey, FilterQuery, Loaded, LoadedCollection, Populate } from '../typings.js';
|
|
2
|
-
import { ArrayCollection } from './ArrayCollection.js';
|
|
1
|
+
import type { EntityDTO, EntityKey, EntityProperty, FilterQuery, IPrimaryKey, Loaded, LoadedCollection, Populate, Primary } from '../typings.js';
|
|
3
2
|
import { Reference } from './Reference.js';
|
|
4
3
|
import type { Transaction } from '../connections/Connection.js';
|
|
5
4
|
import type { CountOptions, FindOptions } from '../drivers/IDatabaseDriver.js';
|
|
@@ -9,10 +8,18 @@ export interface MatchingOptions<T extends object, P extends string = never> ext
|
|
|
9
8
|
store?: boolean;
|
|
10
9
|
ctx?: Transaction;
|
|
11
10
|
}
|
|
12
|
-
export declare class Collection<T extends object, O extends object = object>
|
|
11
|
+
export declare class Collection<T extends object, O extends object = object> {
|
|
12
|
+
readonly owner: O;
|
|
13
|
+
[k: number]: T;
|
|
14
|
+
private readonly items;
|
|
15
|
+
private initialized;
|
|
16
|
+
private dirty;
|
|
17
|
+
private partial;
|
|
18
|
+
private snapshot;
|
|
13
19
|
private readonly?;
|
|
20
|
+
private _count?;
|
|
21
|
+
private _property?;
|
|
14
22
|
private _populated?;
|
|
15
|
-
private _snapshot?;
|
|
16
23
|
constructor(owner: O, items?: T[], initialized?: boolean);
|
|
17
24
|
/**
|
|
18
25
|
* Creates new Collection instance, assigns it to the owning entity and sets the items to it (propagating them to their inverse sides)
|
|
@@ -39,59 +46,124 @@ export declare class Collection<T extends object, O extends object = object> ext
|
|
|
39
46
|
*/
|
|
40
47
|
getItems(check?: boolean): T[];
|
|
41
48
|
toJSON<TT extends T>(): EntityDTO<TT>[];
|
|
42
|
-
add<TT extends T>(entity: TT | Reference<TT> | Iterable<TT | Reference<TT>>, ...entities: (TT | Reference<TT>)[]):
|
|
49
|
+
add<TT extends T>(entity: TT | Reference<TT> | Iterable<TT | Reference<TT>>, ...entities: (TT | Reference<TT>)[]): number;
|
|
43
50
|
/**
|
|
44
|
-
*
|
|
51
|
+
* Remove specified item(s) from the collection. Note that removing item from collection does not necessarily imply deleting the target entity,
|
|
52
|
+
* it means we are disconnecting the relation - removing items from collection, not removing entities from database - `Collection.remove()`
|
|
53
|
+
* is not the same as `em.remove()`. If we want to delete the entity by removing it from collection, we need to enable `orphanRemoval: true`,
|
|
54
|
+
* which tells the ORM we don't want orphaned entities to exist, so we know those should be removed.
|
|
45
55
|
*/
|
|
46
|
-
remove<TT extends T>(entity: TT | Reference<TT> | Iterable<TT | Reference<TT>> | ((item: TT) => boolean), ...entities: (TT | Reference<TT>)[]):
|
|
56
|
+
remove<TT extends T>(entity: TT | Reference<TT> | Iterable<TT | Reference<TT>> | ((item: TT) => boolean), ...entities: (TT | Reference<TT>)[]): number;
|
|
47
57
|
contains<TT extends T>(item: TT | Reference<TT>, check?: boolean): boolean;
|
|
48
58
|
count(): number;
|
|
49
59
|
isEmpty(): boolean;
|
|
60
|
+
shouldPopulate(populated?: boolean): boolean;
|
|
61
|
+
populated(populated?: boolean | undefined): void;
|
|
62
|
+
init<TT extends T, P extends string = never>(options?: InitCollectionOptions<TT, P>): Promise<LoadedCollection<Loaded<TT, P>>>;
|
|
63
|
+
private getEntityManager;
|
|
64
|
+
private createCondition;
|
|
65
|
+
private createManyToManyCondition;
|
|
66
|
+
private createLoadCountCondition;
|
|
67
|
+
private checkInitialized;
|
|
50
68
|
/**
|
|
51
|
-
*
|
|
69
|
+
* re-orders items after searching with `$in` operator
|
|
70
|
+
*/
|
|
71
|
+
private reorderItems;
|
|
72
|
+
private cancelOrphanRemoval;
|
|
73
|
+
private validateModification;
|
|
74
|
+
toArray<TT extends T>(): EntityDTO<TT>[];
|
|
75
|
+
getIdentifiers<U extends IPrimaryKey = Primary<T> & IPrimaryKey>(field?: string | string[]): U[];
|
|
76
|
+
/**
|
|
77
|
+
* @internal
|
|
78
|
+
*/
|
|
79
|
+
addWithoutPropagation(entity: T): void;
|
|
80
|
+
set(items: Iterable<T | Reference<T>>): void;
|
|
81
|
+
private compare;
|
|
82
|
+
/**
|
|
83
|
+
* @internal
|
|
84
|
+
*/
|
|
85
|
+
hydrate(items: T[], forcePropagate?: boolean, partial?: boolean): void;
|
|
86
|
+
/**
|
|
87
|
+
* Remove all items from the collection. Note that removing items from collection does not necessarily imply deleting the target entity,
|
|
88
|
+
* it means we are disconnecting the relation - removing items from collection, not removing entities from database - `Collection.remove()`
|
|
89
|
+
* is not the same as `em.remove()`. If we want to delete the entity by removing it from collection, we need to enable `orphanRemoval: true`,
|
|
90
|
+
* which tells the ORM we don't want orphaned entities to exist, so we know those should be removed.
|
|
91
|
+
*/
|
|
92
|
+
removeAll(): void;
|
|
93
|
+
/**
|
|
94
|
+
* @internal
|
|
95
|
+
*/
|
|
96
|
+
removeWithoutPropagation(entity: T): void;
|
|
97
|
+
/**
|
|
98
|
+
* Extracts a slice of the collection items starting at position start to end (exclusive) of the collection.
|
|
99
|
+
* If end is null it returns all elements from start to the end of the collection.
|
|
52
100
|
*/
|
|
53
101
|
slice(start?: number, end?: number): T[];
|
|
54
102
|
/**
|
|
55
|
-
*
|
|
103
|
+
* Tests for the existence of an element that satisfies the given predicate.
|
|
56
104
|
*/
|
|
57
105
|
exists(cb: (item: T) => boolean): boolean;
|
|
58
106
|
/**
|
|
59
|
-
*
|
|
107
|
+
* Returns the first element of this collection that satisfies the predicate.
|
|
108
|
+
*/
|
|
109
|
+
find<S extends T>(cb: (item: T, index: number) => item is S): S | undefined;
|
|
110
|
+
/**
|
|
111
|
+
* Returns the first element of this collection that satisfies the predicate.
|
|
60
112
|
*/
|
|
61
113
|
find(cb: (item: T, index: number) => boolean): T | undefined;
|
|
62
114
|
/**
|
|
63
|
-
*
|
|
115
|
+
* Extracts a subset of the collection items.
|
|
116
|
+
*/
|
|
117
|
+
filter<S extends T>(cb: (item: T, index: number) => item is S): S[];
|
|
118
|
+
/**
|
|
119
|
+
* Extracts a subset of the collection items.
|
|
64
120
|
*/
|
|
65
121
|
filter(cb: (item: T, index: number) => boolean): T[];
|
|
66
122
|
/**
|
|
67
|
-
*
|
|
123
|
+
* Maps the collection items based on your provided mapper function.
|
|
68
124
|
*/
|
|
69
125
|
map<R>(mapper: (item: T, index: number) => R): R[];
|
|
70
126
|
/**
|
|
71
|
-
*
|
|
127
|
+
* Maps the collection items based on your provided mapper function to a single object.
|
|
128
|
+
*/
|
|
129
|
+
reduce<R>(cb: (obj: R, item: T, index: number) => R, initial?: R): R;
|
|
130
|
+
/**
|
|
131
|
+
* Maps the collection items to a dictionary, indexed by the key you specify.
|
|
132
|
+
* If there are more items with the same key, only the first one will be present.
|
|
72
133
|
*/
|
|
73
134
|
indexBy<K1 extends keyof T, K2 extends keyof T = never>(key: K1): Record<T[K1] & PropertyKey, T>;
|
|
74
135
|
/**
|
|
75
|
-
*
|
|
136
|
+
* Maps the collection items to a dictionary, indexed by the key you specify.
|
|
137
|
+
* If there are more items with the same key, only the first one will be present.
|
|
76
138
|
*/
|
|
77
139
|
indexBy<K1 extends keyof T, K2 extends keyof T = never>(key: K1, valueKey: K2): Record<T[K1] & PropertyKey, T[K2]>;
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
private createManyToManyCondition;
|
|
85
|
-
private createLoadCountCondition;
|
|
86
|
-
private modify;
|
|
87
|
-
private checkInitialized;
|
|
140
|
+
isInitialized(fully?: boolean): boolean;
|
|
141
|
+
isDirty(): boolean;
|
|
142
|
+
isPartial(): boolean;
|
|
143
|
+
setDirty(dirty?: boolean): void;
|
|
144
|
+
get length(): number;
|
|
145
|
+
[Symbol.iterator](): IterableIterator<T>;
|
|
88
146
|
/**
|
|
89
|
-
*
|
|
147
|
+
* @internal
|
|
90
148
|
*/
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
149
|
+
takeSnapshot(forcePropagate?: boolean): void;
|
|
150
|
+
/**
|
|
151
|
+
* @internal
|
|
152
|
+
*/
|
|
153
|
+
getSnapshot(): T[] | undefined;
|
|
154
|
+
/**
|
|
155
|
+
* @internal
|
|
156
|
+
*/
|
|
157
|
+
get property(): EntityProperty;
|
|
158
|
+
/**
|
|
159
|
+
* @internal
|
|
160
|
+
*/
|
|
161
|
+
set property(prop: EntityProperty);
|
|
162
|
+
protected propagate(item: T, method: 'add' | 'remove' | 'takeSnapshot'): void;
|
|
163
|
+
protected propagateToInverseSide(item: T, method: 'add' | 'remove' | 'takeSnapshot'): void;
|
|
164
|
+
protected propagateToOwningSide(item: T, method: 'add' | 'remove' | 'takeSnapshot'): void;
|
|
165
|
+
protected shouldPropagateToCollection(collection: Collection<O, T>, method: 'add' | 'remove' | 'takeSnapshot'): boolean;
|
|
166
|
+
private incrementCount;
|
|
95
167
|
}
|
|
96
168
|
export interface InitCollectionOptions<T, P extends string = never, F extends string = '*', E extends string = never> extends EntityLoaderOptions<T, F, E> {
|
|
97
169
|
dataloader?: boolean;
|