@mikro-orm/core 7.0.0-dev.266 → 7.0.0-dev.267
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.
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ConnectionType, EntityData, EntityMetadata, EntityProperty, FilterQuery, Primary, Dictionary, IPrimaryKey, PopulateOptions, EntityDictionary, AutoPath, ObjectQuery, FilterObject, Populate, EntityName, PopulateHintOptions, Prefixes } 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';
|
|
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,6 +7,7 @@ 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
12
|
import type { Raw } from '../utils/RawQueryFragment.js';
|
|
12
13
|
export declare const EntityManagerType: unique symbol;
|
|
@@ -65,6 +66,10 @@ export interface IDatabaseDriver<C extends Connection = Connection> {
|
|
|
65
66
|
schema?: string;
|
|
66
67
|
parentSchema?: string;
|
|
67
68
|
}): string | undefined;
|
|
69
|
+
/**
|
|
70
|
+
* @internal
|
|
71
|
+
*/
|
|
72
|
+
getORMClass(): Constructor<MikroORM>;
|
|
68
73
|
}
|
|
69
74
|
export type EntityField<T, P extends string = PopulatePath.ALL> = keyof T | PopulatePath.ALL | AutoPath<T, P, `${PopulatePath.ALL}`>;
|
|
70
75
|
export type OrderDefinition<T> = (QueryOrderMap<T> & {
|
|
@@ -1474,7 +1474,7 @@ export class MetadataDiscovery {
|
|
|
1474
1474
|
}
|
|
1475
1475
|
/* v8 ignore next */
|
|
1476
1476
|
if (prop.default != null) {
|
|
1477
|
-
return '' + this.platform.
|
|
1477
|
+
return '' + this.platform.convertVersionValue(prop.default, prop);
|
|
1478
1478
|
}
|
|
1479
1479
|
this.initCustomType(meta, prop, true);
|
|
1480
1480
|
const type = prop.customType?.runtimeType ?? prop.runtimeType ?? prop.type;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mikro-orm/core",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "7.0.0-dev.
|
|
4
|
+
"version": "7.0.0-dev.267",
|
|
5
5
|
"description": "TypeScript ORM for Node.js based on Data Mapper, Unit of Work and Identity Map patterns. Supports MongoDB, MySQL, PostgreSQL and SQLite databases as well as usage with vanilla JavaScript.",
|
|
6
6
|
"exports": {
|
|
7
7
|
"./package.json": "./package.json",
|
package/platforms/Platform.d.ts
CHANGED
|
@@ -66,7 +66,9 @@ export declare abstract class Platform {
|
|
|
66
66
|
$flags?: string;
|
|
67
67
|
};
|
|
68
68
|
isAllowedTopLevelOperator(operator: string): boolean;
|
|
69
|
-
|
|
69
|
+
convertVersionValue(value: Date | number, prop: EntityProperty): Date | string | number | {
|
|
70
|
+
$in: (string | number)[];
|
|
71
|
+
};
|
|
70
72
|
getDefaultVersionLength(): number;
|
|
71
73
|
allowsComparingTuples(): boolean;
|
|
72
74
|
isBigIntProperty(prop: EntityProperty): boolean;
|
package/platforms/Platform.js
CHANGED
|
@@ -272,7 +272,7 @@ export class ChangeSetPersister {
|
|
|
272
272
|
return this.driver.nativeUpdate(changeSet.meta.class, cond, changeSet.payload, options);
|
|
273
273
|
}
|
|
274
274
|
if (meta.versionProperty) {
|
|
275
|
-
cond[meta.versionProperty] = this.platform.
|
|
275
|
+
cond[meta.versionProperty] = this.platform.convertVersionValue(changeSet.entity[meta.versionProperty], meta.properties[meta.versionProperty]);
|
|
276
276
|
}
|
|
277
277
|
this.checkConcurrencyKeys(meta, changeSet, cond);
|
|
278
278
|
return this.driver.nativeUpdate(changeSet.meta.class, cond, changeSet.payload, options);
|
|
@@ -287,7 +287,7 @@ export class ChangeSetPersister {
|
|
|
287
287
|
const cond = Utils.getPrimaryKeyCond(cs.originalEntity, meta.primaryKeys.concat(...meta.concurrencyCheckKeys));
|
|
288
288
|
if (meta.versionProperty) {
|
|
289
289
|
// @ts-ignore
|
|
290
|
-
cond[meta.versionProperty] = this.platform.
|
|
290
|
+
cond[meta.versionProperty] = this.platform.convertVersionValue(cs.entity[meta.versionProperty], meta.properties[meta.versionProperty]);
|
|
291
291
|
}
|
|
292
292
|
return cond;
|
|
293
293
|
});
|
package/utils/Utils.js
CHANGED
|
@@ -123,7 +123,7 @@ export function parseJsonSafe(value) {
|
|
|
123
123
|
}
|
|
124
124
|
export class Utils {
|
|
125
125
|
static PK_SEPARATOR = '~~~';
|
|
126
|
-
static #ORM_VERSION = '7.0.0-dev.
|
|
126
|
+
static #ORM_VERSION = '7.0.0-dev.267';
|
|
127
127
|
/**
|
|
128
128
|
* Checks if the argument is instance of `Object`. Returns false for arrays.
|
|
129
129
|
*/
|