orchid-orm 1.20.1 → 1.21.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/dist/index.d.ts +46 -38
- package/dist/index.js +7 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +7 -3
- package/dist/index.mjs.map +1 -1
- package/package.json +5 -5
package/dist/index.mjs
CHANGED
|
@@ -132,7 +132,7 @@ const getThroughRelation = (table, through) => {
|
|
|
132
132
|
};
|
|
133
133
|
const getSourceRelation = (throughRelation, source) => {
|
|
134
134
|
var _a;
|
|
135
|
-
return (_a = throughRelation.
|
|
135
|
+
return (_a = throughRelation.query.relations[source]) == null ? void 0 : _a.relationConfig;
|
|
136
136
|
};
|
|
137
137
|
const hasRelationHandleCreate = (q, ctx, item, rowIndex, key, primaryKeys, nestedInsert) => {
|
|
138
138
|
const value = item[key];
|
|
@@ -1344,7 +1344,9 @@ const nestedInsert = ({
|
|
|
1344
1344
|
const queries = [];
|
|
1345
1345
|
for (const [, { connect }] of items) {
|
|
1346
1346
|
for (const item of connect) {
|
|
1347
|
-
queries.push(
|
|
1347
|
+
queries.push(
|
|
1348
|
+
_queryFindBy(t.select(...throughPrimaryKeys), [item])
|
|
1349
|
+
);
|
|
1348
1350
|
}
|
|
1349
1351
|
}
|
|
1350
1352
|
connected = await Promise.all(queries);
|
|
@@ -1363,7 +1365,9 @@ const nestedInsert = ({
|
|
|
1363
1365
|
for (const [, { connectOrCreate }] of items) {
|
|
1364
1366
|
for (const item of connectOrCreate) {
|
|
1365
1367
|
queries.push(
|
|
1366
|
-
_queryFindByOptional(t.select(...throughPrimaryKeys), [
|
|
1368
|
+
_queryFindByOptional(t.select(...throughPrimaryKeys), [
|
|
1369
|
+
item.where
|
|
1370
|
+
])
|
|
1367
1371
|
);
|
|
1368
1372
|
}
|
|
1369
1373
|
}
|