@mikro-orm/core 7.0.4 → 7.0.5-dev.1
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 +583 -884
- package/EntityManager.js +1895 -1922
- package/MikroORM.d.ts +74 -103
- package/MikroORM.js +179 -178
- package/README.md +1 -1
- package/cache/CacheAdapter.d.ts +36 -36
- package/cache/FileCacheAdapter.d.ts +24 -30
- package/cache/FileCacheAdapter.js +78 -80
- package/cache/GeneratedCacheAdapter.d.ts +20 -18
- package/cache/GeneratedCacheAdapter.js +30 -30
- package/cache/MemoryCacheAdapter.d.ts +20 -18
- package/cache/MemoryCacheAdapter.js +36 -35
- package/cache/NullCacheAdapter.d.ts +16 -16
- package/cache/NullCacheAdapter.js +24 -24
- package/connections/Connection.d.ts +84 -95
- package/connections/Connection.js +168 -165
- package/drivers/DatabaseDriver.d.ts +80 -186
- package/drivers/DatabaseDriver.js +443 -450
- package/drivers/IDatabaseDriver.d.ts +301 -440
- package/entity/BaseEntity.d.ts +83 -120
- package/entity/BaseEntity.js +43 -43
- package/entity/Collection.d.ts +179 -212
- package/entity/Collection.js +721 -727
- package/entity/EntityAssigner.d.ts +77 -88
- package/entity/EntityAssigner.js +230 -231
- package/entity/EntityFactory.d.ts +54 -66
- package/entity/EntityFactory.js +383 -425
- package/entity/EntityHelper.d.ts +22 -34
- package/entity/EntityHelper.js +267 -280
- package/entity/EntityIdentifier.d.ts +4 -4
- package/entity/EntityIdentifier.js +10 -10
- package/entity/EntityLoader.d.ts +72 -98
- package/entity/EntityLoader.js +723 -753
- package/entity/EntityRepository.d.ts +201 -316
- package/entity/EntityRepository.js +213 -213
- package/entity/PolymorphicRef.d.ts +5 -5
- package/entity/PolymorphicRef.js +10 -10
- package/entity/Reference.d.ts +82 -126
- package/entity/Reference.js +274 -278
- package/entity/WrappedEntity.d.ts +72 -115
- package/entity/WrappedEntity.js +166 -168
- package/entity/defineEntity.d.ts +636 -1315
- package/entity/defineEntity.js +518 -527
- package/entity/utils.d.ts +3 -13
- package/entity/utils.js +73 -71
- package/entity/validators.js +43 -43
- package/entity/wrap.js +8 -8
- package/enums.d.ts +253 -258
- package/enums.js +252 -251
- package/errors.d.ts +72 -114
- package/errors.js +253 -350
- package/events/EventManager.d.ts +14 -26
- package/events/EventManager.js +77 -79
- package/events/EventSubscriber.d.ts +29 -29
- package/events/TransactionEventBroadcaster.d.ts +8 -15
- package/events/TransactionEventBroadcaster.js +14 -14
- package/exceptions.d.ts +40 -23
- package/exceptions.js +52 -35
- package/hydration/Hydrator.d.ts +17 -42
- package/hydration/Hydrator.js +43 -43
- package/hydration/ObjectHydrator.d.ts +17 -50
- package/hydration/ObjectHydrator.js +416 -481
- package/index.d.ts +2 -116
- package/index.js +1 -10
- package/logging/DefaultLogger.d.ts +32 -34
- package/logging/DefaultLogger.js +86 -86
- package/logging/Logger.d.ts +41 -41
- package/logging/SimpleLogger.d.ts +11 -13
- package/logging/SimpleLogger.js +22 -22
- package/logging/colors.d.ts +6 -6
- package/logging/colors.js +10 -11
- package/logging/inspect.js +7 -7
- package/metadata/EntitySchema.d.ts +127 -211
- package/metadata/EntitySchema.js +398 -397
- package/metadata/MetadataDiscovery.d.ts +114 -114
- package/metadata/MetadataDiscovery.js +1870 -1951
- package/metadata/MetadataProvider.d.ts +21 -24
- package/metadata/MetadataProvider.js +84 -82
- package/metadata/MetadataStorage.d.ts +32 -38
- package/metadata/MetadataStorage.js +118 -118
- package/metadata/MetadataValidator.d.ts +39 -39
- package/metadata/MetadataValidator.js +338 -381
- package/metadata/discover-entities.d.ts +2 -5
- package/metadata/discover-entities.js +37 -35
- package/metadata/types.d.ts +531 -615
- package/naming-strategy/AbstractNamingStrategy.d.ts +39 -54
- package/naming-strategy/AbstractNamingStrategy.js +85 -90
- package/naming-strategy/EntityCaseNamingStrategy.d.ts +6 -6
- package/naming-strategy/EntityCaseNamingStrategy.js +22 -22
- package/naming-strategy/MongoNamingStrategy.d.ts +6 -6
- package/naming-strategy/MongoNamingStrategy.js +18 -18
- package/naming-strategy/NamingStrategy.d.ts +99 -109
- package/naming-strategy/UnderscoreNamingStrategy.d.ts +7 -7
- package/naming-strategy/UnderscoreNamingStrategy.js +21 -21
- package/not-supported.js +4 -7
- package/package.json +1 -1
- package/platforms/ExceptionConverter.d.ts +1 -1
- package/platforms/ExceptionConverter.js +4 -4
- package/platforms/Platform.d.ts +301 -310
- package/platforms/Platform.js +640 -663
- package/serialization/EntitySerializer.d.ts +26 -49
- package/serialization/EntitySerializer.js +218 -224
- package/serialization/EntityTransformer.d.ts +6 -10
- package/serialization/EntityTransformer.js +217 -219
- package/serialization/SerializationContext.d.ts +23 -27
- package/serialization/SerializationContext.js +105 -105
- package/types/ArrayType.d.ts +8 -8
- package/types/ArrayType.js +33 -33
- package/types/BigIntType.d.ts +10 -17
- package/types/BigIntType.js +37 -37
- package/types/BlobType.d.ts +3 -3
- package/types/BlobType.js +13 -13
- package/types/BooleanType.d.ts +4 -4
- package/types/BooleanType.js +12 -12
- package/types/CharacterType.d.ts +2 -2
- package/types/CharacterType.js +6 -6
- package/types/DateTimeType.d.ts +5 -5
- package/types/DateTimeType.js +15 -15
- package/types/DateType.d.ts +5 -5
- package/types/DateType.js +15 -15
- package/types/DecimalType.d.ts +7 -7
- package/types/DecimalType.js +26 -26
- package/types/DoubleType.d.ts +3 -3
- package/types/DoubleType.js +12 -12
- package/types/EnumArrayType.d.ts +5 -5
- package/types/EnumArrayType.js +24 -24
- package/types/EnumType.d.ts +3 -3
- package/types/EnumType.js +11 -11
- package/types/FloatType.d.ts +3 -3
- package/types/FloatType.js +9 -9
- package/types/IntegerType.d.ts +3 -3
- package/types/IntegerType.js +9 -9
- package/types/IntervalType.d.ts +4 -4
- package/types/IntervalType.js +12 -12
- package/types/JsonType.d.ts +8 -8
- package/types/JsonType.js +32 -32
- package/types/MediumIntType.d.ts +1 -1
- package/types/MediumIntType.js +3 -3
- package/types/SmallIntType.d.ts +3 -3
- package/types/SmallIntType.js +9 -9
- package/types/StringType.d.ts +4 -4
- package/types/StringType.js +12 -12
- package/types/TextType.d.ts +3 -3
- package/types/TextType.js +9 -9
- package/types/TimeType.d.ts +5 -5
- package/types/TimeType.js +17 -17
- package/types/TinyIntType.d.ts +3 -3
- package/types/TinyIntType.js +10 -10
- package/types/Type.d.ts +79 -83
- package/types/Type.js +82 -82
- package/types/Uint8ArrayType.d.ts +4 -4
- package/types/Uint8ArrayType.js +21 -21
- package/types/UnknownType.d.ts +4 -4
- package/types/UnknownType.js +12 -12
- package/types/UuidType.d.ts +5 -5
- package/types/UuidType.js +19 -19
- package/types/index.d.ts +49 -75
- package/types/index.js +26 -52
- package/typings.d.ts +737 -1250
- package/typings.js +231 -244
- package/unit-of-work/ChangeSet.d.ts +26 -26
- package/unit-of-work/ChangeSet.js +56 -56
- package/unit-of-work/ChangeSetComputer.d.ts +12 -12
- package/unit-of-work/ChangeSetComputer.js +170 -178
- package/unit-of-work/ChangeSetPersister.d.ts +44 -63
- package/unit-of-work/ChangeSetPersister.js +421 -442
- package/unit-of-work/CommitOrderCalculator.d.ts +40 -40
- package/unit-of-work/CommitOrderCalculator.js +88 -89
- package/unit-of-work/IdentityMap.d.ts +31 -31
- package/unit-of-work/IdentityMap.js +105 -105
- package/unit-of-work/UnitOfWork.d.ts +141 -181
- package/unit-of-work/UnitOfWork.js +1183 -1200
- package/utils/AbstractMigrator.d.ts +91 -111
- package/utils/AbstractMigrator.js +275 -275
- package/utils/AbstractSchemaGenerator.d.ts +34 -43
- package/utils/AbstractSchemaGenerator.js +122 -121
- package/utils/AsyncContext.d.ts +3 -3
- package/utils/AsyncContext.js +35 -34
- package/utils/Configuration.d.ts +808 -852
- package/utils/Configuration.js +344 -359
- package/utils/Cursor.d.ts +22 -40
- package/utils/Cursor.js +127 -135
- package/utils/DataloaderUtils.d.ts +43 -58
- package/utils/DataloaderUtils.js +198 -203
- package/utils/EntityComparator.d.ts +81 -98
- package/utils/EntityComparator.js +732 -828
- package/utils/NullHighlighter.d.ts +1 -1
- package/utils/NullHighlighter.js +3 -3
- package/utils/QueryHelper.d.ts +51 -79
- package/utils/QueryHelper.js +361 -372
- package/utils/RawQueryFragment.d.ts +34 -50
- package/utils/RawQueryFragment.js +105 -107
- package/utils/RequestContext.d.ts +32 -32
- package/utils/RequestContext.js +53 -52
- package/utils/TransactionContext.d.ts +16 -16
- package/utils/TransactionContext.js +27 -27
- package/utils/TransactionManager.d.ts +58 -58
- package/utils/TransactionManager.js +197 -199
- package/utils/Utils.d.ts +145 -204
- package/utils/Utils.js +812 -812
- package/utils/clone.js +113 -104
- package/utils/env-vars.js +88 -90
- package/utils/fs-utils.d.ts +15 -15
- package/utils/fs-utils.js +181 -180
- package/utils/upsert-utils.d.ts +5 -20
- package/utils/upsert-utils.js +116 -114
|
@@ -1,33 +1,6 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
ConnectionType,
|
|
3
|
-
Constructor,
|
|
4
|
-
EntityData,
|
|
5
|
-
EntityMetadata,
|
|
6
|
-
EntityProperty,
|
|
7
|
-
FilterQuery,
|
|
8
|
-
Primary,
|
|
9
|
-
Dictionary,
|
|
10
|
-
IPrimaryKey,
|
|
11
|
-
PopulateOptions,
|
|
12
|
-
EntityDictionary,
|
|
13
|
-
AutoPath,
|
|
14
|
-
ObjectQuery,
|
|
15
|
-
FilterObject,
|
|
16
|
-
Populate,
|
|
17
|
-
EntityName,
|
|
18
|
-
PopulateHintOptions,
|
|
19
|
-
Prefixes,
|
|
20
|
-
} from '../typings.js';
|
|
1
|
+
import type { ConnectionType, Constructor, EntityData, EntityMetadata, EntityProperty, FilterQuery, Primary, Dictionary, IPrimaryKey, PopulateOptions, EntityDictionary, AutoPath, ObjectQuery, FilterObject, Populate, EntityName, PopulateHintOptions, Prefixes } from '../typings.js';
|
|
21
2
|
import type { Connection, QueryResult, Transaction } from '../connections/Connection.js';
|
|
22
|
-
import type {
|
|
23
|
-
FlushMode,
|
|
24
|
-
LockMode,
|
|
25
|
-
QueryOrderMap,
|
|
26
|
-
QueryFlag,
|
|
27
|
-
LoadStrategy,
|
|
28
|
-
PopulateHint,
|
|
29
|
-
PopulatePath,
|
|
30
|
-
} from '../enums.js';
|
|
3
|
+
import type { FlushMode, LockMode, QueryOrderMap, QueryFlag, LoadStrategy, PopulateHint, PopulatePath } from '../enums.js';
|
|
31
4
|
import type { Platform } from '../platforms/Platform.js';
|
|
32
5
|
import type { MetadataStorage } from '../metadata/MetadataStorage.js';
|
|
33
6
|
import type { Collection } from '../entity/Collection.js';
|
|
@@ -41,471 +14,359 @@ import type { Raw } from '../utils/RawQueryFragment.js';
|
|
|
41
14
|
export declare const EntityManagerType: unique symbol;
|
|
42
15
|
/** Interface defining the contract for all database drivers. */
|
|
43
16
|
export interface IDatabaseDriver<C extends Connection = Connection> {
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
where: FilterQuery<T>,
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
where: FilterQuery<T>,
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
/** Counts entities matching the given condition. */
|
|
123
|
-
count<T extends object, P extends string = never>(
|
|
124
|
-
entityName: EntityName<T>,
|
|
125
|
-
where: FilterQuery<T>,
|
|
126
|
-
options?: CountOptions<T, P>,
|
|
127
|
-
): Promise<number>;
|
|
128
|
-
/** Executes a MongoDB aggregation pipeline (MongoDB driver only). */
|
|
129
|
-
aggregate(entityName: EntityName, pipeline: any[]): Promise<any[]>;
|
|
130
|
-
/** Maps raw database result to entity data, converting column names to property names. */
|
|
131
|
-
mapResult<T extends object>(
|
|
132
|
-
result: EntityDictionary<T>,
|
|
133
|
-
meta: EntityMetadata<T>,
|
|
134
|
-
populate?: PopulateOptions<T>[],
|
|
135
|
-
): EntityData<T> | null;
|
|
136
|
-
/**
|
|
137
|
-
* When driver uses pivot tables for M:N, this method will load identifiers for given collections from them
|
|
138
|
-
*/
|
|
139
|
-
loadFromPivotTable<T extends object, O extends object>(
|
|
140
|
-
prop: EntityProperty,
|
|
141
|
-
owners: Primary<O>[][],
|
|
142
|
-
where?: FilterQuery<T>,
|
|
143
|
-
orderBy?: OrderDefinition<T>,
|
|
144
|
-
ctx?: Transaction,
|
|
145
|
-
options?: FindOptions<T, any, any, any>,
|
|
146
|
-
pivotJoin?: boolean,
|
|
147
|
-
): Promise<Dictionary<T[]>>;
|
|
148
|
-
/** Returns the database platform abstraction for this driver. */
|
|
149
|
-
getPlatform(): Platform;
|
|
150
|
-
/** Sets the metadata storage used by this driver. */
|
|
151
|
-
setMetadata(metadata: MetadataStorage): void;
|
|
152
|
-
/** Returns the metadata storage used by this driver. */
|
|
153
|
-
getMetadata(): MetadataStorage;
|
|
154
|
-
/**
|
|
155
|
-
* Returns name of the underlying database dependencies (e.g. `mongodb` or `mysql2`)
|
|
156
|
-
* for SQL drivers it also returns `knex` in the array as connectors are not used directly there
|
|
157
|
-
*/
|
|
158
|
-
getDependencies(): string[];
|
|
159
|
-
/** Acquires a pessimistic lock on the given entity. */
|
|
160
|
-
lockPessimistic<T extends object>(entity: T, options: LockOptions): Promise<void>;
|
|
161
|
-
/**
|
|
162
|
-
* Converts native db errors to standardized driver exceptions
|
|
163
|
-
*/
|
|
164
|
-
convertException(exception: Error): DriverException;
|
|
165
|
-
/**
|
|
166
|
-
* @internal
|
|
167
|
-
*/
|
|
168
|
-
getSchemaName(
|
|
169
|
-
meta?: EntityMetadata,
|
|
170
|
-
options?: {
|
|
171
|
-
schema?: string;
|
|
172
|
-
parentSchema?: string;
|
|
173
|
-
},
|
|
174
|
-
): string | undefined;
|
|
175
|
-
/**
|
|
176
|
-
* @internal
|
|
177
|
-
*/
|
|
178
|
-
getORMClass(): Constructor<MikroORM>;
|
|
17
|
+
[EntityManagerType]: EntityManager<this>;
|
|
18
|
+
readonly config: Configuration;
|
|
19
|
+
/** Creates a new EntityManager instance for this driver. */
|
|
20
|
+
createEntityManager(useContext?: boolean): this[typeof EntityManagerType];
|
|
21
|
+
/** Opens a connection to the database. */
|
|
22
|
+
connect(options?: {
|
|
23
|
+
skipOnConnect?: boolean;
|
|
24
|
+
}): Promise<C>;
|
|
25
|
+
/** Closes the database connection. */
|
|
26
|
+
close(force?: boolean): Promise<void>;
|
|
27
|
+
/** Closes and re-establishes the database connection. */
|
|
28
|
+
reconnect(options?: {
|
|
29
|
+
skipOnConnect?: boolean;
|
|
30
|
+
}): Promise<C>;
|
|
31
|
+
/** Returns the underlying database connection (write or read replica). */
|
|
32
|
+
getConnection(type?: ConnectionType): C;
|
|
33
|
+
/**
|
|
34
|
+
* Finds selection of entities
|
|
35
|
+
*/
|
|
36
|
+
find<T extends object, P extends string = never, F extends string = never, E extends string = never>(entityName: EntityName<T>, where: FilterQuery<T>, options?: FindOptions<T, P, F, E>): Promise<EntityData<T>[]>;
|
|
37
|
+
/**
|
|
38
|
+
* Finds single entity (table row, document)
|
|
39
|
+
*/
|
|
40
|
+
findOne<T extends object, P extends string = never, F extends string = never, E extends string = never>(entityName: EntityName<T>, where: FilterQuery<T>, options?: FindOneOptions<T, P, F, E>): Promise<EntityData<T> | null>;
|
|
41
|
+
/** Finds entities backed by a virtual (expression-based) definition. */
|
|
42
|
+
findVirtual<T extends object>(entityName: EntityName<T>, where: FilterQuery<T>, options: FindOptions<T, any, any, any>): Promise<EntityData<T>[]>;
|
|
43
|
+
/** Returns an async iterator that streams query results one entity at a time. */
|
|
44
|
+
stream<T extends object>(entityName: EntityName<T>, where: FilterQuery<T>, options: StreamOptions<T>): AsyncIterableIterator<T>;
|
|
45
|
+
/** Inserts a single row into the database. */
|
|
46
|
+
nativeInsert<T extends object>(entityName: EntityName<T>, data: EntityDictionary<T>, options?: NativeInsertUpdateOptions<T>): Promise<QueryResult<T>>;
|
|
47
|
+
/** Inserts multiple rows into the database in a single batch operation. */
|
|
48
|
+
nativeInsertMany<T extends object>(entityName: EntityName<T>, data: EntityDictionary<T>[], options?: NativeInsertUpdateManyOptions<T>, transform?: (sql: string) => string): Promise<QueryResult<T>>;
|
|
49
|
+
/** Updates rows matching the given condition. */
|
|
50
|
+
nativeUpdate<T extends object>(entityName: EntityName<T>, where: FilterQuery<T>, data: EntityDictionary<T>, options?: NativeInsertUpdateOptions<T>): Promise<QueryResult<T>>;
|
|
51
|
+
/** Updates multiple rows with different payloads in a single batch operation. */
|
|
52
|
+
nativeUpdateMany<T extends object>(entityName: EntityName<T>, where: FilterQuery<T>[], data: EntityDictionary<T>[], options?: NativeInsertUpdateManyOptions<T>): Promise<QueryResult<T>>;
|
|
53
|
+
/** Deletes rows matching the given condition. */
|
|
54
|
+
nativeDelete<T extends object>(entityName: EntityName<T>, where: FilterQuery<T>, options?: NativeDeleteOptions<T>): Promise<QueryResult<T>>;
|
|
55
|
+
/** Persists changes to M:N collections (inserts/deletes pivot table rows). */
|
|
56
|
+
syncCollections<T extends object, O extends object>(collections: Iterable<Collection<T, O>>, options?: DriverMethodOptions): Promise<void>;
|
|
57
|
+
/** Counts entities matching the given condition. */
|
|
58
|
+
count<T extends object, P extends string = never>(entityName: EntityName<T>, where: FilterQuery<T>, options?: CountOptions<T, P>): Promise<number>;
|
|
59
|
+
/** Executes a MongoDB aggregation pipeline (MongoDB driver only). */
|
|
60
|
+
aggregate(entityName: EntityName, pipeline: any[]): Promise<any[]>;
|
|
61
|
+
/** Maps raw database result to entity data, converting column names to property names. */
|
|
62
|
+
mapResult<T extends object>(result: EntityDictionary<T>, meta: EntityMetadata<T>, populate?: PopulateOptions<T>[]): EntityData<T> | null;
|
|
63
|
+
/**
|
|
64
|
+
* When driver uses pivot tables for M:N, this method will load identifiers for given collections from them
|
|
65
|
+
*/
|
|
66
|
+
loadFromPivotTable<T extends object, O extends object>(prop: EntityProperty, owners: Primary<O>[][], where?: FilterQuery<T>, orderBy?: OrderDefinition<T>, ctx?: Transaction, options?: FindOptions<T, any, any, any>, pivotJoin?: boolean): Promise<Dictionary<T[]>>;
|
|
67
|
+
/** Returns the database platform abstraction for this driver. */
|
|
68
|
+
getPlatform(): Platform;
|
|
69
|
+
/** Sets the metadata storage used by this driver. */
|
|
70
|
+
setMetadata(metadata: MetadataStorage): void;
|
|
71
|
+
/** Returns the metadata storage used by this driver. */
|
|
72
|
+
getMetadata(): MetadataStorage;
|
|
73
|
+
/**
|
|
74
|
+
* Returns name of the underlying database dependencies (e.g. `mongodb` or `mysql2`)
|
|
75
|
+
* for SQL drivers it also returns `knex` in the array as connectors are not used directly there
|
|
76
|
+
*/
|
|
77
|
+
getDependencies(): string[];
|
|
78
|
+
/** Acquires a pessimistic lock on the given entity. */
|
|
79
|
+
lockPessimistic<T extends object>(entity: T, options: LockOptions): Promise<void>;
|
|
80
|
+
/**
|
|
81
|
+
* Converts native db errors to standardized driver exceptions
|
|
82
|
+
*/
|
|
83
|
+
convertException(exception: Error): DriverException;
|
|
84
|
+
/**
|
|
85
|
+
* @internal
|
|
86
|
+
*/
|
|
87
|
+
getSchemaName(meta?: EntityMetadata, options?: {
|
|
88
|
+
schema?: string;
|
|
89
|
+
parentSchema?: string;
|
|
90
|
+
}): string | undefined;
|
|
91
|
+
/**
|
|
92
|
+
* @internal
|
|
93
|
+
*/
|
|
94
|
+
getORMClass(): Constructor<MikroORM>;
|
|
179
95
|
}
|
|
180
96
|
/** Represents a field selector for entity queries (property name or wildcard). */
|
|
181
|
-
export type EntityField<T, P extends string = PopulatePath.ALL> =
|
|
182
|
-
| keyof T
|
|
183
|
-
| PopulatePath.ALL
|
|
184
|
-
| AutoPath<T, P, `${PopulatePath.ALL}`>;
|
|
97
|
+
export type EntityField<T, P extends string = PopulatePath.ALL> = keyof T | PopulatePath.ALL | AutoPath<T, P, `${PopulatePath.ALL}`>;
|
|
185
98
|
/** Defines the ordering for query results, either a single order map or an array of them. */
|
|
186
|
-
export type OrderDefinition<T> =
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
})
|
|
190
|
-
| QueryOrderMap<T>[];
|
|
99
|
+
export type OrderDefinition<T> = (QueryOrderMap<T> & {
|
|
100
|
+
0?: never;
|
|
101
|
+
}) | QueryOrderMap<T>[];
|
|
191
102
|
/** Options for `em.findAll()`, extends FindOptions with an optional `where` clause. */
|
|
192
|
-
export interface FindAllOptions<
|
|
193
|
-
|
|
194
|
-
P extends string = never,
|
|
195
|
-
F extends string = never,
|
|
196
|
-
E extends string = never,
|
|
197
|
-
> extends FindOptions<T, P, F, E> {
|
|
198
|
-
where?: FilterQuery<T>;
|
|
103
|
+
export interface FindAllOptions<T, P extends string = never, F extends string = never, E extends string = never> extends FindOptions<T, P, F, E> {
|
|
104
|
+
where?: FilterQuery<T>;
|
|
199
105
|
}
|
|
200
106
|
/** Options for streaming query results via `em.stream()`. */
|
|
201
|
-
export interface StreamOptions<
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
* You can opt out of this behavior by specifying `mergeResults: false`. This will yield every row from
|
|
213
|
-
* the SQL result, but still mapped to entities, meaning that to-many collections will contain at most
|
|
214
|
-
* a single item, and you will get duplicate root entities when they have multiple items in the populated
|
|
215
|
-
* collection.
|
|
216
|
-
*
|
|
217
|
-
* @default true
|
|
218
|
-
*/
|
|
219
|
-
mergeResults?: boolean;
|
|
107
|
+
export interface StreamOptions<Entity, Populate extends string = never, Fields extends string = never, Exclude extends string = never> extends Omit<FindAllOptions<Entity, Populate, Fields, Exclude>, 'cache' | 'before' | 'after' | 'first' | 'last' | 'overfetch' | 'strategy'> {
|
|
108
|
+
/**
|
|
109
|
+
* When populating to-many relations, the ORM streams fully merged entities instead of yielding every row.
|
|
110
|
+
* You can opt out of this behavior by specifying `mergeResults: false`. This will yield every row from
|
|
111
|
+
* the SQL result, but still mapped to entities, meaning that to-many collections will contain at most
|
|
112
|
+
* a single item, and you will get duplicate root entities when they have multiple items in the populated
|
|
113
|
+
* collection.
|
|
114
|
+
*
|
|
115
|
+
* @default true
|
|
116
|
+
*/
|
|
117
|
+
mergeResults?: boolean;
|
|
220
118
|
}
|
|
221
119
|
/** Configuration for enabling/disabling named filters on a query. */
|
|
222
120
|
export type FilterOptions = Dictionary<boolean | Dictionary> | string[] | boolean;
|
|
223
121
|
/** Specifies which relations to populate and which fields to select or exclude. */
|
|
224
|
-
export interface LoadHint<
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
Excludes extends string = never,
|
|
229
|
-
> {
|
|
230
|
-
populate?: Populate<Entity, Hint>;
|
|
231
|
-
fields?: readonly AutoPath<Entity, Fields, `${PopulatePath.ALL}`>[];
|
|
232
|
-
exclude?: readonly AutoPath<Entity, Excludes>[];
|
|
122
|
+
export interface LoadHint<Entity, Hint extends string = never, Fields extends string = never, Excludes extends string = never> {
|
|
123
|
+
populate?: Populate<Entity, Hint>;
|
|
124
|
+
fields?: readonly AutoPath<Entity, Fields, `${PopulatePath.ALL}`>[];
|
|
125
|
+
exclude?: readonly AutoPath<Entity, Excludes>[];
|
|
233
126
|
}
|
|
234
127
|
/** Options for `em.find()` queries, including population, ordering, pagination, and locking. */
|
|
235
|
-
export interface FindOptions<
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
unionWhereStrategy?: 'union-all' | 'union';
|
|
270
|
-
/** Used for ordering of the populate queries. If not specified, the value of `options.orderBy` is used. */
|
|
271
|
-
populateOrderBy?: OrderDefinition<Entity>;
|
|
272
|
-
/** Per-relation overrides for populate loading behavior. Keys are populate paths (same as used in `populate`). */
|
|
273
|
-
populateHints?: [Hint] extends [never]
|
|
274
|
-
? never
|
|
275
|
-
: {
|
|
128
|
+
export interface FindOptions<Entity, Hint extends string = never, Fields extends string = never, Excludes extends string = never> extends LoadHint<Entity, Hint, Fields, Excludes> {
|
|
129
|
+
/**
|
|
130
|
+
* Where condition for populated relations. This will have no effect on the root entity.
|
|
131
|
+
* With `select-in` strategy, this is applied only to the populate queries.
|
|
132
|
+
* With `joined` strategy, those are applied as `join on` conditions.
|
|
133
|
+
* When you use a nested condition on a to-many relation, it will produce a nested inner join,
|
|
134
|
+
* discarding the collection items based on the child condition.
|
|
135
|
+
*/
|
|
136
|
+
populateWhere?: ObjectQuery<Entity> | PopulateHint | `${PopulateHint}`;
|
|
137
|
+
/**
|
|
138
|
+
* Filter condition for populated relations. This is similar to `populateWhere`, but will produce a `left join`
|
|
139
|
+
* when nesting the condition. This is used for implementation of joined filters.
|
|
140
|
+
*/
|
|
141
|
+
populateFilter?: ObjectQuery<Entity>;
|
|
142
|
+
/**
|
|
143
|
+
* Index-friendly alternative to `$or` for conditions that span joined relations.
|
|
144
|
+
* Each array element becomes an independent branch combined via `UNION ALL` subquery:
|
|
145
|
+
* `WHERE pk IN (branch_1 UNION ALL branch_2 ... branch_N)`.
|
|
146
|
+
* The database plans each branch independently, enabling per-table index usage
|
|
147
|
+
* (e.g. GIN trigram indexes for fuzzy search across related entities).
|
|
148
|
+
* sql only
|
|
149
|
+
*/
|
|
150
|
+
unionWhere?: ObjectQuery<Entity>[];
|
|
151
|
+
/**
|
|
152
|
+
* Strategy for combining `unionWhere` branches.
|
|
153
|
+
* - `'union-all'` (default) — skips deduplication, faster for most use cases.
|
|
154
|
+
* - `'union'` — deduplicates rows between branches; useful when branch overlap is very high.
|
|
155
|
+
* sql only
|
|
156
|
+
*/
|
|
157
|
+
unionWhereStrategy?: 'union-all' | 'union';
|
|
158
|
+
/** Used for ordering of the populate queries. If not specified, the value of `options.orderBy` is used. */
|
|
159
|
+
populateOrderBy?: OrderDefinition<Entity>;
|
|
160
|
+
/** Per-relation overrides for populate loading behavior. Keys are populate paths (same as used in `populate`). */
|
|
161
|
+
populateHints?: [Hint] extends [never] ? never : {
|
|
276
162
|
[K in Prefixes<Hint>]?: PopulateHintOptions;
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
| string
|
|
297
|
-
| {
|
|
163
|
+
};
|
|
164
|
+
/** Ordering of the results.Can be an object or array of objects, keys are property names, values are ordering (asc/desc) */
|
|
165
|
+
orderBy?: OrderDefinition<Entity>;
|
|
166
|
+
/** Control result caching for this query. Result cache is by default disabled, not to be confused with the identity map. */
|
|
167
|
+
cache?: boolean | number | [string, number];
|
|
168
|
+
/**
|
|
169
|
+
* Limit the number of returned results. If you try to use limit/offset on a query that joins a to-many relation, pagination mechanism
|
|
170
|
+
* will be triggered, resulting in a subquery condition, to apply this limit only to the root entities
|
|
171
|
+
* instead of the cartesian product you get from a database in this case.
|
|
172
|
+
*/
|
|
173
|
+
limit?: number;
|
|
174
|
+
/**
|
|
175
|
+
* Sets the offset. If you try to use limit/offset on a query that joins a to-many relation, pagination mechanism
|
|
176
|
+
* will be triggered, resulting in a subquery condition, to apply this limit only to the root entities
|
|
177
|
+
* instead of the cartesian product you get from a database in this case.
|
|
178
|
+
*/
|
|
179
|
+
offset?: number;
|
|
180
|
+
/** Fetch items `before` this cursor. */
|
|
181
|
+
before?: string | {
|
|
298
182
|
startCursor: string | null;
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
after?:
|
|
303
|
-
| string
|
|
304
|
-
| {
|
|
183
|
+
} | FilterObject<Entity>;
|
|
184
|
+
/** Fetch items `after` this cursor. */
|
|
185
|
+
after?: string | {
|
|
305
186
|
endCursor: string | null;
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
em?: EntityManager;
|
|
187
|
+
} | FilterObject<Entity>;
|
|
188
|
+
/** Fetch `first` N items. */
|
|
189
|
+
first?: number;
|
|
190
|
+
/** Fetch `last` N items. */
|
|
191
|
+
last?: number;
|
|
192
|
+
/** Fetch one more item than `first`/`last`, enabled automatically in `em.findByCursor` to check if there is a next page. */
|
|
193
|
+
overfetch?: boolean;
|
|
194
|
+
refresh?: boolean;
|
|
195
|
+
convertCustomTypes?: boolean;
|
|
196
|
+
disableIdentityMap?: boolean;
|
|
197
|
+
schema?: string;
|
|
198
|
+
flags?: QueryFlag[];
|
|
199
|
+
/** sql only */
|
|
200
|
+
groupBy?: string | string[];
|
|
201
|
+
having?: FilterQuery<Entity>;
|
|
202
|
+
/** sql only */
|
|
203
|
+
strategy?: LoadStrategy | `${LoadStrategy}`;
|
|
204
|
+
flushMode?: FlushMode | `${FlushMode}`;
|
|
205
|
+
filters?: FilterOptions;
|
|
206
|
+
/** sql only */
|
|
207
|
+
lockMode?: Exclude<LockMode, LockMode.OPTIMISTIC>;
|
|
208
|
+
/** sql only */
|
|
209
|
+
lockTableAliases?: string[];
|
|
210
|
+
ctx?: Transaction;
|
|
211
|
+
connectionType?: ConnectionType;
|
|
212
|
+
/** SQL: appended to FROM clause (e.g. `'force index(my_index)'`); MongoDB: index name or spec passed as `hint`. */
|
|
213
|
+
indexHint?: string | Dictionary;
|
|
214
|
+
/** sql only */
|
|
215
|
+
comments?: string | string[];
|
|
216
|
+
/** sql only */
|
|
217
|
+
hintComments?: string | string[];
|
|
218
|
+
/** SQL: collation name string applied as COLLATE to ORDER BY; MongoDB: CollationOptions object. */
|
|
219
|
+
collation?: CollationOptions | string;
|
|
220
|
+
/** mongodb only */
|
|
221
|
+
maxTimeMS?: number;
|
|
222
|
+
/** mongodb only */
|
|
223
|
+
allowDiskUse?: boolean;
|
|
224
|
+
loggerContext?: LogContext;
|
|
225
|
+
logging?: LoggingOptions;
|
|
226
|
+
/** @internal used to apply filters to the auto-joined relations */
|
|
227
|
+
em?: EntityManager;
|
|
348
228
|
}
|
|
349
229
|
/** Options for cursor-based pagination via `em.findByCursor()`. */
|
|
350
|
-
export interface FindByCursorOptions<
|
|
351
|
-
|
|
352
|
-
P extends string = never,
|
|
353
|
-
F extends string = never,
|
|
354
|
-
E extends string = never,
|
|
355
|
-
I extends boolean = true,
|
|
356
|
-
> extends Omit<FindAllOptions<T, P, F, E>, 'limit' | 'offset'> {
|
|
357
|
-
includeCount?: I;
|
|
230
|
+
export interface FindByCursorOptions<T extends object, P extends string = never, F extends string = never, E extends string = never, I extends boolean = true> extends Omit<FindAllOptions<T, P, F, E>, 'limit' | 'offset'> {
|
|
231
|
+
includeCount?: I;
|
|
358
232
|
}
|
|
359
233
|
/** Options for `em.findOne()`, extends FindOptions with optimistic lock version support. */
|
|
360
|
-
export interface FindOneOptions<
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
F extends string = never,
|
|
364
|
-
E extends string = never,
|
|
365
|
-
> extends Omit<FindOptions<T, P, F, E>, 'limit' | 'lockMode'> {
|
|
366
|
-
lockMode?: LockMode;
|
|
367
|
-
lockVersion?: number | Date;
|
|
234
|
+
export interface FindOneOptions<T, P extends string = never, F extends string = never, E extends string = never> extends Omit<FindOptions<T, P, F, E>, 'limit' | 'lockMode'> {
|
|
235
|
+
lockMode?: LockMode;
|
|
236
|
+
lockVersion?: number | Date;
|
|
368
237
|
}
|
|
369
238
|
/** Options for `em.findOneOrFail()`, adds a custom error handler for missing entities. */
|
|
370
|
-
export interface FindOneOrFailOptions<
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
F extends string = never,
|
|
374
|
-
E extends string = never,
|
|
375
|
-
> extends FindOneOptions<T, P, F, E> {
|
|
376
|
-
failHandler?: (entityName: string, where: Dictionary | IPrimaryKey | any) => Error;
|
|
377
|
-
strict?: boolean;
|
|
239
|
+
export interface FindOneOrFailOptions<T extends object, P extends string = never, F extends string = never, E extends string = never> extends FindOneOptions<T, P, F, E> {
|
|
240
|
+
failHandler?: (entityName: string, where: Dictionary | IPrimaryKey | any) => Error;
|
|
241
|
+
strict?: boolean;
|
|
378
242
|
}
|
|
379
243
|
/** Options for native insert and update operations. */
|
|
380
244
|
export interface NativeInsertUpdateOptions<T> {
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
245
|
+
convertCustomTypes?: boolean;
|
|
246
|
+
ctx?: Transaction;
|
|
247
|
+
schema?: string;
|
|
248
|
+
/** `nativeUpdate()` only option */
|
|
249
|
+
upsert?: boolean;
|
|
250
|
+
loggerContext?: LogContext;
|
|
251
|
+
/** sql only */
|
|
252
|
+
unionWhere?: ObjectQuery<T>[];
|
|
253
|
+
/** sql only */
|
|
254
|
+
unionWhereStrategy?: 'union-all' | 'union';
|
|
255
|
+
filters?: FilterOptions;
|
|
256
|
+
/** @internal */
|
|
257
|
+
em?: EntityManager;
|
|
394
258
|
}
|
|
395
259
|
/** Options for batch native insert and update operations. */
|
|
396
260
|
export interface NativeInsertUpdateManyOptions<T> extends NativeInsertUpdateOptions<T> {
|
|
397
|
-
|
|
261
|
+
processCollections?: boolean;
|
|
398
262
|
}
|
|
399
263
|
/** Options for `em.upsert()`, controlling conflict resolution behavior. */
|
|
400
|
-
export interface UpsertOptions<Entity, Fields extends string = never> extends Omit<
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
onConflictExcludeFields?: AutoPath<Entity, Fields, `${PopulatePath.ALL}`>[];
|
|
408
|
-
onConflictWhere?: FilterQuery<Entity>;
|
|
409
|
-
disableIdentityMap?: boolean;
|
|
264
|
+
export interface UpsertOptions<Entity, Fields extends string = never> extends Omit<NativeInsertUpdateOptions<Entity>, 'upsert'> {
|
|
265
|
+
onConflictFields?: (keyof Entity)[] | Raw;
|
|
266
|
+
onConflictAction?: 'ignore' | 'merge';
|
|
267
|
+
onConflictMergeFields?: AutoPath<Entity, Fields, `${PopulatePath.ALL}`>[];
|
|
268
|
+
onConflictExcludeFields?: AutoPath<Entity, Fields, `${PopulatePath.ALL}`>[];
|
|
269
|
+
onConflictWhere?: FilterQuery<Entity>;
|
|
270
|
+
disableIdentityMap?: boolean;
|
|
410
271
|
}
|
|
411
272
|
/** Options for `em.upsertMany()`, adds batch size control. */
|
|
412
273
|
export interface UpsertManyOptions<Entity, Fields extends string = never> extends UpsertOptions<Entity, Fields> {
|
|
413
|
-
|
|
274
|
+
batchSize?: number;
|
|
414
275
|
}
|
|
415
276
|
/** Options for `em.count()` queries. */
|
|
416
277
|
export interface CountOptions<T extends object, P extends string = never> {
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
278
|
+
filters?: FilterOptions;
|
|
279
|
+
schema?: string;
|
|
280
|
+
groupBy?: string | readonly string[];
|
|
281
|
+
having?: FilterQuery<T>;
|
|
282
|
+
cache?: boolean | number | [string, number];
|
|
283
|
+
populate?: Populate<T, P>;
|
|
284
|
+
populateWhere?: ObjectQuery<T> | PopulateHint | `${PopulateHint}`;
|
|
285
|
+
populateFilter?: ObjectQuery<T>;
|
|
286
|
+
/** @see FindOptions.unionWhere */
|
|
287
|
+
unionWhere?: ObjectQuery<T>[];
|
|
288
|
+
/** @see FindOptions.unionWhereStrategy */
|
|
289
|
+
unionWhereStrategy?: 'union-all' | 'union';
|
|
290
|
+
ctx?: Transaction;
|
|
291
|
+
connectionType?: ConnectionType;
|
|
292
|
+
flushMode?: FlushMode | `${FlushMode}`;
|
|
293
|
+
/** SQL: appended to FROM clause (e.g. `'force index(my_index)'`); MongoDB: index name or spec passed as `hint`. */
|
|
294
|
+
indexHint?: string | Dictionary;
|
|
295
|
+
/** sql only */
|
|
296
|
+
comments?: string | string[];
|
|
297
|
+
/** sql only */
|
|
298
|
+
hintComments?: string | string[];
|
|
299
|
+
/** SQL: collation name string applied as COLLATE; MongoDB: CollationOptions object. */
|
|
300
|
+
collation?: CollationOptions | string;
|
|
301
|
+
/** mongodb only */
|
|
302
|
+
maxTimeMS?: number;
|
|
303
|
+
loggerContext?: LogContext;
|
|
304
|
+
logging?: LoggingOptions;
|
|
305
|
+
/** @internal used to apply filters to the auto-joined relations */
|
|
306
|
+
em?: EntityManager;
|
|
446
307
|
}
|
|
447
308
|
/** Options for `em.qb().update()` operations. */
|
|
448
309
|
export interface UpdateOptions<T> {
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
310
|
+
filters?: FilterOptions;
|
|
311
|
+
schema?: string;
|
|
312
|
+
ctx?: Transaction;
|
|
313
|
+
/** sql only */
|
|
314
|
+
unionWhere?: ObjectQuery<T>[];
|
|
315
|
+
/** sql only */
|
|
316
|
+
unionWhereStrategy?: 'union-all' | 'union';
|
|
456
317
|
}
|
|
457
318
|
/** Options for `em.qb().delete()` operations. */
|
|
458
319
|
export interface DeleteOptions<T> extends DriverMethodOptions {
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
320
|
+
filters?: FilterOptions;
|
|
321
|
+
/** sql only */
|
|
322
|
+
unionWhere?: ObjectQuery<T>[];
|
|
323
|
+
/** sql only */
|
|
324
|
+
unionWhereStrategy?: 'union-all' | 'union';
|
|
325
|
+
/** @internal */
|
|
326
|
+
em?: EntityManager;
|
|
466
327
|
}
|
|
467
328
|
/** Options for `em.nativeDelete()` operations. */
|
|
468
329
|
export interface NativeDeleteOptions<T> extends DriverMethodOptions {
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
330
|
+
filters?: FilterOptions;
|
|
331
|
+
/** sql only */
|
|
332
|
+
unionWhere?: ObjectQuery<T>[];
|
|
333
|
+
/** sql only */
|
|
334
|
+
unionWhereStrategy?: 'union-all' | 'union';
|
|
335
|
+
/** @internal */
|
|
336
|
+
em?: EntityManager;
|
|
476
337
|
}
|
|
477
338
|
/** Options for pessimistic and optimistic lock operations. */
|
|
478
339
|
export interface LockOptions extends DriverMethodOptions {
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
340
|
+
lockMode?: LockMode;
|
|
341
|
+
lockVersion?: number | Date;
|
|
342
|
+
lockTableAliases?: string[];
|
|
343
|
+
logging?: LoggingOptions;
|
|
483
344
|
}
|
|
484
345
|
/** Base options shared by all driver methods (transaction context, schema, logging). */
|
|
485
346
|
export interface DriverMethodOptions {
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
347
|
+
ctx?: Transaction;
|
|
348
|
+
schema?: string;
|
|
349
|
+
loggerContext?: LogContext;
|
|
489
350
|
}
|
|
490
351
|
/** MongoDB-style collation options for locale-aware string comparison. */
|
|
491
352
|
export interface CollationOptions {
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
353
|
+
locale: string;
|
|
354
|
+
caseLevel?: boolean;
|
|
355
|
+
caseFirst?: string;
|
|
356
|
+
strength?: number;
|
|
357
|
+
numericOrdering?: boolean;
|
|
358
|
+
alternate?: string;
|
|
359
|
+
maxVariable?: string;
|
|
360
|
+
backwards?: boolean;
|
|
500
361
|
}
|
|
501
362
|
/** Options for `em.getReference()`, controlling wrapping and type conversion. */
|
|
502
363
|
export interface GetReferenceOptions {
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
364
|
+
wrapped?: boolean;
|
|
365
|
+
convertCustomTypes?: boolean;
|
|
366
|
+
schema?: string;
|
|
367
|
+
/**
|
|
368
|
+
* Property name to use for identity map lookup instead of the primary key.
|
|
369
|
+
* This is useful for creating references by unique non-PK properties.
|
|
370
|
+
*/
|
|
371
|
+
key?: string;
|
|
511
372
|
}
|