@mikro-orm/knex 6.0.0-dev.284 → 6.0.0-dev.286
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/AbstractSqlDriver.js +8 -4
- package/package.json +2 -2
package/AbstractSqlDriver.js
CHANGED
|
@@ -237,7 +237,8 @@ class AbstractSqlDriver extends core_1.DatabaseDriver {
|
|
|
237
237
|
for (const prop of targetProps) {
|
|
238
238
|
if (prop.fieldNames.length > 1) { // composite keys
|
|
239
239
|
const fk = prop.fieldNames.map(name => root[`${relationAlias}__${name}`]);
|
|
240
|
-
|
|
240
|
+
const pk = core_1.Utils.mapFlatCompositePrimaryKey(fk, prop);
|
|
241
|
+
relationPojo[prop.name] = pk.every(val => val != null) ? pk : null;
|
|
241
242
|
}
|
|
242
243
|
else if (prop.runtimeType === 'Date') {
|
|
243
244
|
const alias = `${relationAlias}__${prop.fieldNames[0]}`;
|
|
@@ -623,17 +624,20 @@ class AbstractSqlDriver extends core_1.DatabaseDriver {
|
|
|
623
624
|
const kqb = qb.delete({ [coll.property.mappedBy]: pks })
|
|
624
625
|
.getKnexQuery()
|
|
625
626
|
.whereNotIn(cols, insertDiff);
|
|
626
|
-
|
|
627
|
+
await this.rethrow(this.execute(kqb));
|
|
628
|
+
continue;
|
|
627
629
|
}
|
|
628
630
|
const kqb = qb.update({ [coll.property.mappedBy]: null })
|
|
629
631
|
.getKnexQuery()
|
|
630
632
|
.whereNotIn(cols, insertDiff);
|
|
631
|
-
|
|
633
|
+
await this.rethrow(this.execute(kqb));
|
|
634
|
+
continue;
|
|
632
635
|
}
|
|
633
636
|
const kqb = qb.update({ [coll.property.mappedBy]: pks })
|
|
634
637
|
.getKnexQuery()
|
|
635
638
|
.whereIn(cols, insertDiff);
|
|
636
|
-
|
|
639
|
+
await this.rethrow(this.execute(kqb));
|
|
640
|
+
continue;
|
|
637
641
|
}
|
|
638
642
|
/* istanbul ignore next */
|
|
639
643
|
const pivotMeta = this.metadata.find(coll.property.pivotEntity);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mikro-orm/knex",
|
|
3
|
-
"version": "6.0.0-dev.
|
|
3
|
+
"version": "6.0.0-dev.286",
|
|
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",
|
|
@@ -66,6 +66,6 @@
|
|
|
66
66
|
"@mikro-orm/core": "^5.0.0"
|
|
67
67
|
},
|
|
68
68
|
"peerDependencies": {
|
|
69
|
-
"@mikro-orm/core": "6.0.0-dev.
|
|
69
|
+
"@mikro-orm/core": "6.0.0-dev.286"
|
|
70
70
|
}
|
|
71
71
|
}
|