@mikro-orm/core 6.4.1-dev.2 → 6.4.1-dev.4
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.js
CHANGED
|
@@ -674,7 +674,6 @@ class EntityManager {
|
|
|
674
674
|
refresh: true,
|
|
675
675
|
initialized: true,
|
|
676
676
|
schema: options.schema,
|
|
677
|
-
convertCustomTypes: true,
|
|
678
677
|
});
|
|
679
678
|
const uniqueFields = options.onConflictFields ?? (utils_1.Utils.isPlainObject(where) ? Object.keys(where) : meta.primaryKeys);
|
|
680
679
|
const returning = (0, utils_1.getOnConflictReturningFields)(meta, data, uniqueFields, options);
|
|
@@ -838,7 +837,6 @@ class EntityManager {
|
|
|
838
837
|
refresh: true,
|
|
839
838
|
initialized: true,
|
|
840
839
|
schema: options.schema,
|
|
841
|
-
convertCustomTypes: true,
|
|
842
840
|
});
|
|
843
841
|
if (!(0, entity_1.helper)(entity).hasPrimaryKey()) {
|
|
844
842
|
loadPK.set(entity, allWhere[i]);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mikro-orm/core",
|
|
3
|
-
"version": "6.4.1-dev.
|
|
3
|
+
"version": "6.4.1-dev.4",
|
|
4
4
|
"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.",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"module": "index.mjs",
|
|
@@ -64,7 +64,7 @@
|
|
|
64
64
|
"esprima": "4.0.1",
|
|
65
65
|
"fs-extra": "11.2.0",
|
|
66
66
|
"globby": "11.1.0",
|
|
67
|
-
"mikro-orm": "6.4.1-dev.
|
|
67
|
+
"mikro-orm": "6.4.1-dev.4",
|
|
68
68
|
"reflect-metadata": "0.2.2"
|
|
69
69
|
}
|
|
70
70
|
}
|
|
@@ -359,13 +359,21 @@ class ChangeSetPersister {
|
|
|
359
359
|
* We do need to map to the change set payload too, as it will be used in the originalEntityData for new entities.
|
|
360
360
|
*/
|
|
361
361
|
mapReturnedValues(entity, payload, row, meta, upsert = false) {
|
|
362
|
-
if ((this.usesReturningStatement
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
362
|
+
if ((!this.usesReturningStatement && !upsert) || !row || !utils_1.Utils.hasObjectKeys(row)) {
|
|
363
|
+
return;
|
|
364
|
+
}
|
|
365
|
+
const mapped = this.comparator.mapResult(meta.className, row);
|
|
366
|
+
if (entity) {
|
|
367
|
+
this.hydrator.hydrate(entity, meta, mapped, this.factory, 'full', false, true);
|
|
368
|
+
}
|
|
369
|
+
if (upsert) {
|
|
370
|
+
for (const prop of meta.props) {
|
|
371
|
+
if (prop.customType && prop.name in mapped) {
|
|
372
|
+
mapped[prop.name] = prop.customType.convertToJSValue(mapped[prop.name], this.platform);
|
|
373
|
+
}
|
|
366
374
|
}
|
|
367
|
-
Object.assign(payload, mapped); // merge to the changeset payload, so it gets saved to the entity snapshot
|
|
368
375
|
}
|
|
376
|
+
Object.assign(payload, mapped);
|
|
369
377
|
}
|
|
370
378
|
}
|
|
371
379
|
exports.ChangeSetPersister = ChangeSetPersister;
|