@mikro-orm/core 7.0.4 → 7.0.5-dev.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/EntityManager.d.ts +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
package/platforms/Platform.d.ts
CHANGED
|
@@ -1,18 +1,6 @@
|
|
|
1
1
|
import { EntityRepository } from '../entity/EntityRepository.js';
|
|
2
2
|
import { type NamingStrategy } from '../naming-strategy/NamingStrategy.js';
|
|
3
|
-
import type {
|
|
4
|
-
Constructor,
|
|
5
|
-
EntityMetadata,
|
|
6
|
-
EntityProperty,
|
|
7
|
-
IPrimaryKey,
|
|
8
|
-
ISchemaGenerator,
|
|
9
|
-
PopulateOptions,
|
|
10
|
-
Primary,
|
|
11
|
-
SimpleColumnMeta,
|
|
12
|
-
FilterQuery,
|
|
13
|
-
EntityValue,
|
|
14
|
-
EntityKey,
|
|
15
|
-
} from '../typings.js';
|
|
3
|
+
import type { Constructor, EntityMetadata, EntityProperty, IPrimaryKey, ISchemaGenerator, PopulateOptions, Primary, SimpleColumnMeta, FilterQuery, EntityValue, EntityKey } from '../typings.js';
|
|
16
4
|
import { ExceptionConverter } from './ExceptionConverter.js';
|
|
17
5
|
import type { EntityManager } from '../EntityManager.js';
|
|
18
6
|
import type { Configuration } from '../utils/Configuration.js';
|
|
@@ -25,302 +13,305 @@ import { Raw } from '../utils/RawQueryFragment.js';
|
|
|
25
13
|
export declare const JsonProperty: unique symbol;
|
|
26
14
|
/** Abstract base class providing database-specific behavior and SQL dialect differences. */
|
|
27
15
|
export declare abstract class Platform {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
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
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
value: {
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
convertVersionValue(
|
|
116
|
-
value: Date | number,
|
|
117
|
-
prop: EntityProperty,
|
|
118
|
-
):
|
|
119
|
-
| Date
|
|
120
|
-
| string
|
|
121
|
-
| number
|
|
122
|
-
| {
|
|
16
|
+
protected readonly exceptionConverter: ExceptionConverter;
|
|
17
|
+
protected config: Configuration;
|
|
18
|
+
protected namingStrategy: NamingStrategy;
|
|
19
|
+
protected timezone?: string;
|
|
20
|
+
/** Whether this driver uses pivot tables for M:N relations (SQL drivers do, MongoDB does not). */
|
|
21
|
+
usesPivotTable(): boolean;
|
|
22
|
+
/** Whether this driver supports database transactions. */
|
|
23
|
+
supportsTransactions(): boolean;
|
|
24
|
+
/** Whether the driver wraps operations in implicit transactions by default. */
|
|
25
|
+
usesImplicitTransactions(): boolean;
|
|
26
|
+
/** Returns the default naming strategy constructor for this platform. */
|
|
27
|
+
getNamingStrategy(): {
|
|
28
|
+
new (): NamingStrategy;
|
|
29
|
+
};
|
|
30
|
+
/** Whether the driver supports RETURNING clause (e.g. PostgreSQL). */
|
|
31
|
+
usesReturningStatement(): boolean;
|
|
32
|
+
/** Whether the driver supports OUTPUT clause (e.g. MSSQL). */
|
|
33
|
+
usesOutputStatement(): boolean;
|
|
34
|
+
/** Whether DELETE statements require explicit CASCADE keyword. */
|
|
35
|
+
usesCascadeStatement(): boolean;
|
|
36
|
+
/** for postgres native enums */
|
|
37
|
+
supportsNativeEnums(): boolean;
|
|
38
|
+
/** for postgres text enums (default) */
|
|
39
|
+
usesEnumCheckConstraints(): boolean;
|
|
40
|
+
/** Returns the check constraint expression for an enum array column, or null if unsupported. */
|
|
41
|
+
getEnumArrayCheckConstraintExpression(column: string, items: string[]): string | null;
|
|
42
|
+
/** Whether this platform supports materialized views. */
|
|
43
|
+
supportsMaterializedViews(): boolean;
|
|
44
|
+
/** Returns the schema helper instance for this platform, or undefined if not supported. */
|
|
45
|
+
getSchemaHelper(): unknown;
|
|
46
|
+
/** Whether the platform automatically creates indexes on foreign key columns. */
|
|
47
|
+
indexForeignKeys(): boolean;
|
|
48
|
+
/**
|
|
49
|
+
* Whether or not the driver supports retuning list of created PKs back when multi-inserting
|
|
50
|
+
*/
|
|
51
|
+
usesBatchInserts(): boolean;
|
|
52
|
+
/**
|
|
53
|
+
* Whether or not the driver supports updating many records at once
|
|
54
|
+
*/
|
|
55
|
+
usesBatchUpdates(): boolean;
|
|
56
|
+
/** Whether the platform supports the DEFAULT keyword in INSERT statements. */
|
|
57
|
+
usesDefaultKeyword(): boolean;
|
|
58
|
+
/**
|
|
59
|
+
* Normalizes primary key wrapper to scalar value (e.g. mongodb's ObjectId to string)
|
|
60
|
+
*/
|
|
61
|
+
normalizePrimaryKey<T extends number | string = number | string>(data: Primary<T> | IPrimaryKey): T;
|
|
62
|
+
/**
|
|
63
|
+
* Converts scalar primary key representation to native driver wrapper (e.g. string to mongodb's ObjectId)
|
|
64
|
+
*/
|
|
65
|
+
denormalizePrimaryKey(data: IPrimaryKey): IPrimaryKey;
|
|
66
|
+
/**
|
|
67
|
+
* Returns the SQL specific for the platform to get the current timestamp
|
|
68
|
+
*/
|
|
69
|
+
getCurrentTimestampSQL(length?: number): string;
|
|
70
|
+
/** Returns the SQL type declaration for datetime columns. */
|
|
71
|
+
getDateTimeTypeDeclarationSQL(column: {
|
|
72
|
+
length?: number;
|
|
73
|
+
}): string;
|
|
74
|
+
/** Returns the default fractional seconds precision for datetime columns. */
|
|
75
|
+
getDefaultDateTimeLength(): number;
|
|
76
|
+
/** Returns the default length for varchar columns. */
|
|
77
|
+
getDefaultVarcharLength(): number;
|
|
78
|
+
/** Returns the default length for char columns. */
|
|
79
|
+
getDefaultCharLength(): number;
|
|
80
|
+
/** Returns the SQL type declaration for date columns. */
|
|
81
|
+
getDateTypeDeclarationSQL(length?: number): string;
|
|
82
|
+
/** Returns the SQL type declaration for time columns. */
|
|
83
|
+
getTimeTypeDeclarationSQL(length?: number): string;
|
|
84
|
+
/** Returns the SQL operator used for regular expression matching. */
|
|
85
|
+
getRegExpOperator(val?: unknown, flags?: string): string;
|
|
86
|
+
/** Builds the SQL clause and parameters for a regular expression condition. */
|
|
87
|
+
mapRegExpCondition(mappedKey: string, value: {
|
|
88
|
+
$re: string;
|
|
89
|
+
$flags?: string;
|
|
90
|
+
}): {
|
|
91
|
+
sql: string;
|
|
92
|
+
params: unknown[];
|
|
93
|
+
};
|
|
94
|
+
/** Converts a JavaScript RegExp into a platform-specific regex representation. */
|
|
95
|
+
getRegExpValue(val: RegExp): {
|
|
96
|
+
$re: string;
|
|
97
|
+
$flags?: string;
|
|
98
|
+
};
|
|
99
|
+
/** Whether the given operator is allowed at the top level of a query condition. */
|
|
100
|
+
isAllowedTopLevelOperator(operator: string): boolean;
|
|
101
|
+
/** Converts a version field value for comparison in optimistic locking queries. */
|
|
102
|
+
convertVersionValue(value: Date | number, prop: EntityProperty): Date | string | number | {
|
|
123
103
|
$in: (string | number)[];
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
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
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
104
|
+
};
|
|
105
|
+
/** Returns the default fractional seconds precision for version timestamp columns. */
|
|
106
|
+
getDefaultVersionLength(): number;
|
|
107
|
+
/** Whether the platform supports tuple comparison in WHERE clauses. */
|
|
108
|
+
allowsComparingTuples(): boolean;
|
|
109
|
+
/** Whether the given property maps to a bigint database column. */
|
|
110
|
+
isBigIntProperty(prop: EntityProperty): boolean;
|
|
111
|
+
/** Returns the default schema name for this platform (e.g. "public" for PostgreSQL). */
|
|
112
|
+
getDefaultSchemaName(): string | undefined;
|
|
113
|
+
/** Returns the SQL type declaration for boolean columns. */
|
|
114
|
+
getBooleanTypeDeclarationSQL(): string;
|
|
115
|
+
/** Returns the SQL type declaration for integer columns. */
|
|
116
|
+
getIntegerTypeDeclarationSQL(column: {
|
|
117
|
+
length?: number;
|
|
118
|
+
unsigned?: boolean;
|
|
119
|
+
autoincrement?: boolean;
|
|
120
|
+
}): string;
|
|
121
|
+
getSmallIntTypeDeclarationSQL(column: {
|
|
122
|
+
length?: number;
|
|
123
|
+
unsigned?: boolean;
|
|
124
|
+
autoincrement?: boolean;
|
|
125
|
+
}): string;
|
|
126
|
+
getMediumIntTypeDeclarationSQL(column: {
|
|
127
|
+
length?: number;
|
|
128
|
+
unsigned?: boolean;
|
|
129
|
+
autoincrement?: boolean;
|
|
130
|
+
}): string;
|
|
131
|
+
getTinyIntTypeDeclarationSQL(column: {
|
|
132
|
+
length?: number;
|
|
133
|
+
unsigned?: boolean;
|
|
134
|
+
autoincrement?: boolean;
|
|
135
|
+
}): string;
|
|
136
|
+
getBigIntTypeDeclarationSQL(column: {
|
|
137
|
+
length?: number;
|
|
138
|
+
unsigned?: boolean;
|
|
139
|
+
autoincrement?: boolean;
|
|
140
|
+
}): string;
|
|
141
|
+
getCharTypeDeclarationSQL(column: {
|
|
142
|
+
length?: number;
|
|
143
|
+
}): string;
|
|
144
|
+
getVarcharTypeDeclarationSQL(column: {
|
|
145
|
+
length?: number;
|
|
146
|
+
}): string;
|
|
147
|
+
getIntervalTypeDeclarationSQL(column: {
|
|
148
|
+
length?: number;
|
|
149
|
+
}): string;
|
|
150
|
+
getTextTypeDeclarationSQL(_column: {
|
|
151
|
+
length?: number;
|
|
152
|
+
}): string;
|
|
153
|
+
getEnumTypeDeclarationSQL(column: {
|
|
154
|
+
items?: unknown[];
|
|
155
|
+
fieldNames: string[];
|
|
156
|
+
length?: number;
|
|
157
|
+
unsigned?: boolean;
|
|
158
|
+
autoincrement?: boolean;
|
|
159
|
+
}): string;
|
|
160
|
+
getFloatDeclarationSQL(): string;
|
|
161
|
+
getDoubleDeclarationSQL(): string;
|
|
162
|
+
getDecimalTypeDeclarationSQL(column: {
|
|
163
|
+
precision?: number;
|
|
164
|
+
scale?: number;
|
|
165
|
+
}): string;
|
|
166
|
+
getUuidTypeDeclarationSQL(column: {
|
|
167
|
+
length?: number;
|
|
168
|
+
}): string;
|
|
169
|
+
/** Extracts the base type name from a full SQL type declaration (e.g. "varchar(255)" -> "varchar"). */
|
|
170
|
+
extractSimpleType(type: string): string;
|
|
171
|
+
/**
|
|
172
|
+
* This should be used only to compare types, it can strip some information like the length.
|
|
173
|
+
*/
|
|
174
|
+
normalizeColumnType(type: string, options: {
|
|
175
|
+
length?: number;
|
|
176
|
+
precision?: number;
|
|
177
|
+
scale?: number;
|
|
178
|
+
}): string;
|
|
179
|
+
/** Returns the mapped Type instance for a given SQL/runtime type string. */
|
|
180
|
+
getMappedType(type: string): Type<unknown>;
|
|
181
|
+
/** Returns the default mapped Type for a given type string when no custom mapping is configured. */
|
|
182
|
+
getDefaultMappedType(type: string): Type<unknown>;
|
|
183
|
+
/** Whether the platform supports multiple cascade paths to the same table. */
|
|
184
|
+
supportsMultipleCascadePaths(): boolean;
|
|
185
|
+
/**
|
|
186
|
+
* Returns true if the platform supports ON UPDATE foreign key rules.
|
|
187
|
+
* Oracle doesn't support ON UPDATE rules.
|
|
188
|
+
*/
|
|
189
|
+
supportsOnUpdate(): boolean;
|
|
190
|
+
/** Whether the connection supports executing multiple SQL statements in a single call. */
|
|
191
|
+
supportsMultipleStatements(): boolean;
|
|
192
|
+
/** Whether the platform supports the UNION WHERE optimization for multi-branch queries. */
|
|
193
|
+
supportsUnionWhere(): boolean;
|
|
194
|
+
/** Returns the SQL type declaration used for array storage. */
|
|
195
|
+
getArrayDeclarationSQL(): string;
|
|
196
|
+
/** Serializes a string array into its database storage format. */
|
|
197
|
+
marshallArray(values: string[]): string;
|
|
198
|
+
/** Deserializes a database-stored array string back into a string array. */
|
|
199
|
+
unmarshallArray(value: string): string[];
|
|
200
|
+
getBlobDeclarationSQL(): string;
|
|
201
|
+
getJsonDeclarationSQL(): string;
|
|
202
|
+
getSearchJsonPropertySQL(path: string, type: string, aliased: boolean): string | Raw;
|
|
203
|
+
getSearchJsonPropertyKey(path: string[], type: string, aliased: boolean, value?: unknown): string | Raw;
|
|
204
|
+
processJsonCondition<T extends object>(o: FilterQuery<T>, value: EntityValue<T>, path: EntityKey<T>[], alias: boolean): FilterQuery<T>;
|
|
205
|
+
protected getJsonValueType(value: unknown): string;
|
|
206
|
+
getJsonIndexDefinition(index: {
|
|
207
|
+
columnNames: string[];
|
|
208
|
+
}): string[];
|
|
209
|
+
getFullTextWhereClause(prop: EntityProperty): string;
|
|
210
|
+
supportsCreatingFullTextIndex(): boolean;
|
|
211
|
+
getFullTextIndexExpression(indexName: string, schemaName: string | undefined, tableName: string, columns: SimpleColumnMeta[]): string;
|
|
212
|
+
/** Whether the driver automatically parses JSON columns into JS objects. */
|
|
213
|
+
convertsJsonAutomatically(): boolean;
|
|
214
|
+
/** Converts a JS value to its JSON database representation (typically JSON.stringify). */
|
|
215
|
+
convertJsonToDatabaseValue(value: unknown, context?: TransformContext): unknown;
|
|
216
|
+
/** Converts a database JSON value to its JS representation. */
|
|
217
|
+
convertJsonToJSValue(value: unknown, context?: TransformContext): unknown;
|
|
218
|
+
convertDateToJSValue(value: string | Date): string;
|
|
219
|
+
convertIntervalToJSValue(value: string): unknown;
|
|
220
|
+
convertIntervalToDatabaseValue(value: unknown): unknown;
|
|
221
|
+
usesAsKeyword(): boolean;
|
|
222
|
+
/**
|
|
223
|
+
* Determines how UUID values are compared in the change set tracking.
|
|
224
|
+
* Return `'string'` for inline string comparison (fast), or `'any'` for deep comparison via type methods.
|
|
225
|
+
*/
|
|
226
|
+
compareUuids(): string;
|
|
227
|
+
convertUuidToJSValue(value: unknown): unknown;
|
|
228
|
+
convertUuidToDatabaseValue(value: unknown): unknown;
|
|
229
|
+
/** Parses a string or numeric value into a Date object. */
|
|
230
|
+
parseDate(value: string | number): Date;
|
|
231
|
+
/** Returns the default EntityRepository class used by this platform. */
|
|
232
|
+
getRepositoryClass<T extends object>(): Constructor<EntityRepository<T>>;
|
|
233
|
+
/** Returns the default character set for this platform. */
|
|
234
|
+
getDefaultCharset(): string;
|
|
235
|
+
/** Returns the exception converter for translating native errors to driver exceptions. */
|
|
236
|
+
getExceptionConverter(): ExceptionConverter;
|
|
237
|
+
/**
|
|
238
|
+
* Allows registering extensions of the driver automatically (e.g. `SchemaGenerator` extension in SQL drivers).
|
|
239
|
+
*/
|
|
240
|
+
lookupExtensions(orm: MikroORM): void;
|
|
241
|
+
/** @internal */
|
|
242
|
+
init(orm: MikroORM): void;
|
|
243
|
+
/** Retrieves a registered extension (e.g. SchemaGenerator, Migrator), throwing if not found. */
|
|
244
|
+
getExtension<T>(extensionName: string, extensionKey: string, moduleName: string, em: EntityManager): T;
|
|
245
|
+
getSchemaGenerator(driver: IDatabaseDriver, em?: EntityManager): ISchemaGenerator;
|
|
246
|
+
/** Processes a date value before persisting, applying timezone or format conversions. */
|
|
247
|
+
processDateProperty(value: unknown): string | number | Date;
|
|
248
|
+
/** Wraps a table or column identifier with the platform-specific quote character. */
|
|
249
|
+
quoteIdentifier(id: string | {
|
|
250
|
+
toString: () => string;
|
|
251
|
+
}, quote?: string): string;
|
|
252
|
+
/** Quotes a literal value for safe embedding in SQL. */
|
|
253
|
+
quoteValue(value: any): string;
|
|
254
|
+
escape(value: any): string;
|
|
255
|
+
/** Replaces `?` placeholders in SQL with quoted parameter values. */
|
|
256
|
+
formatQuery(sql: string, params: readonly any[]): string;
|
|
257
|
+
/** Deep-clones embeddable data and tags it for JSON serialization. */
|
|
258
|
+
cloneEmbeddable<T>(data: T): T;
|
|
259
|
+
/** Initializes the platform with the ORM configuration. */
|
|
260
|
+
setConfig(config: Configuration): void;
|
|
261
|
+
/** Returns the current ORM configuration. */
|
|
262
|
+
getConfig(): Configuration;
|
|
263
|
+
/** Returns the configured timezone, or undefined if not set. */
|
|
264
|
+
getTimezone(): string | undefined;
|
|
265
|
+
/** Whether the given property represents a numeric database column. */
|
|
266
|
+
isNumericProperty(prop: EntityProperty, ignoreCustomType?: boolean): boolean;
|
|
267
|
+
/** Whether the given mapped type represents a numeric column. */
|
|
268
|
+
isNumericColumn(mappedType: Type<unknown>): boolean;
|
|
269
|
+
/** Whether the platform supports unsigned integer columns. */
|
|
270
|
+
supportsUnsigned(): boolean;
|
|
271
|
+
/**
|
|
272
|
+
* Returns the default name of index for the given columns
|
|
273
|
+
*/
|
|
274
|
+
getIndexName(tableName: string, columns: string[], type: 'index' | 'unique' | 'foreign' | 'primary' | 'sequence'): string;
|
|
275
|
+
/** Returns the default primary key constraint name. */
|
|
276
|
+
getDefaultPrimaryName(tableName: string, columns: string[]): string;
|
|
277
|
+
/** Whether the platform supports custom names for primary key constraints. */
|
|
278
|
+
supportsCustomPrimaryKeyNames(): boolean;
|
|
279
|
+
/** Whether the given property key is included in the populate hint. */
|
|
280
|
+
isPopulated<T>(key: string, populate: readonly PopulateOptions<T>[] | boolean): boolean;
|
|
281
|
+
/** Whether the given property should be included as a column in the SELECT query. */
|
|
282
|
+
shouldHaveColumn<T>(prop: EntityProperty<T>, populate: readonly PopulateOptions<T>[] | boolean, exclude?: string[], includeFormulas?: boolean, ignoreInlineEmbeddables?: boolean): boolean;
|
|
283
|
+
/**
|
|
284
|
+
* Currently not supported due to how knex does complex sqlite diffing (always based on current schema)
|
|
285
|
+
*/
|
|
286
|
+
/** Whether the platform supports generating down migrations. */
|
|
287
|
+
supportsDownMigrations(): boolean;
|
|
288
|
+
/** Whether the platform supports deferred unique constraints. */
|
|
289
|
+
supportsDeferredUniqueConstraints(): boolean;
|
|
290
|
+
/** Platform-specific validation of entity metadata. */
|
|
291
|
+
validateMetadata(meta: EntityMetadata): void;
|
|
292
|
+
/**
|
|
293
|
+
* Generates a custom order by statement given a set of in order values, eg.
|
|
294
|
+
* ORDER BY (CASE WHEN priority = 'low' THEN 1 WHEN priority = 'medium' THEN 2 ELSE NULL END)
|
|
295
|
+
*/
|
|
296
|
+
generateCustomOrder(escapedColumn: string, values: unknown[]): void;
|
|
297
|
+
/**
|
|
298
|
+
* Returns default client url for given driver (e.g. mongodb://127.0.0.1:27017 for mongodb)
|
|
299
|
+
*/
|
|
300
|
+
getDefaultClientUrl(): string;
|
|
301
|
+
/**
|
|
302
|
+
* @internal
|
|
303
|
+
*/
|
|
304
|
+
castColumn(prop?: {
|
|
305
|
+
columnTypes?: string[];
|
|
306
|
+
}): string;
|
|
307
|
+
/**
|
|
308
|
+
* @internal
|
|
309
|
+
*/
|
|
310
|
+
castJsonValue(prop?: {
|
|
311
|
+
columnTypes?: string[];
|
|
312
|
+
}): string;
|
|
313
|
+
/**
|
|
314
|
+
* @internal
|
|
315
|
+
*/
|
|
316
|
+
clone(): this;
|
|
326
317
|
}
|