orchid-orm 1.73.1 → 1.74.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/dist/index.js +5 -5
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +5 -5
- package/dist/index.mjs.map +1 -1
- package/package.json +4 -4
package/dist/index.js
CHANGED
|
@@ -209,7 +209,7 @@ function joinHasThrough(q, baseQuery, joiningQuery, throughRelation, sourceRelat
|
|
|
209
209
|
function joinHasRelation(baseQuery, joiningQuery, primaryKeys, foreignKeys, len) {
|
|
210
210
|
const baseAs = (0, pqb_internal.getQueryAs)(baseQuery);
|
|
211
211
|
const q = joiningQuery.clone();
|
|
212
|
-
(0, pqb_internal.setQueryObjectValueImmutable)(q, "joinedShapes", baseAs, baseQuery.q.
|
|
212
|
+
(0, pqb_internal.setQueryObjectValueImmutable)(q, "joinedShapes", baseAs, baseQuery.q.selectShape);
|
|
213
213
|
for (let i = 0; i < len; i++) (0, pqb_internal.pushQueryOnForOuter)(q, baseQuery, joiningQuery, foreignKeys[i], `${baseAs}.${primaryKeys[i]}`);
|
|
214
214
|
return q;
|
|
215
215
|
}
|
|
@@ -437,7 +437,7 @@ const makeBelongsToMethod = (tableConfig, table, relation, relationName, query)
|
|
|
437
437
|
const join = (baseQuery, joiningQuery, primaryKeys, foreignKeys) => {
|
|
438
438
|
const baseAs = (0, pqb_internal.getQueryAs)(baseQuery);
|
|
439
439
|
const q = joiningQuery.clone();
|
|
440
|
-
(0, pqb_internal.setQueryObjectValueImmutable)(q, "joinedShapes", baseAs, baseQuery.q.
|
|
440
|
+
(0, pqb_internal.setQueryObjectValueImmutable)(q, "joinedShapes", baseAs, baseQuery.q.selectShape);
|
|
441
441
|
for (let i = 0; i < len; i++) (0, pqb_internal.pushQueryOnForOuter)(q, baseQuery, joiningQuery, primaryKeys[i], `${baseAs}.${foreignKeys[i]}`);
|
|
442
442
|
return q;
|
|
443
443
|
};
|
|
@@ -1129,7 +1129,7 @@ const makeHasAndBelongsToManyMethod = (tableConfig, table, qb, relation, relatio
|
|
|
1129
1129
|
const foreignAs = (0, pqb_internal.getQueryAs)(joiningQuery);
|
|
1130
1130
|
return joinQuery(baseQuery, (0, pqb_internal.getQueryAs)(baseQuery), foreignAs, {
|
|
1131
1131
|
...baseQuery.q.joinedShapes,
|
|
1132
|
-
[foreignAs]: joiningQuery.q.
|
|
1132
|
+
[foreignAs]: joiningQuery.q.selectShape
|
|
1133
1133
|
});
|
|
1134
1134
|
};
|
|
1135
1135
|
return {
|
|
@@ -1147,7 +1147,7 @@ const makeHasAndBelongsToManyMethod = (tableConfig, table, qb, relation, relatio
|
|
|
1147
1147
|
virtualColumn: new HasAndBelongsToManyVirtualColumn(subQuery, pqb_internal.internalSchemaConfig, relationName, state),
|
|
1148
1148
|
joinQuery: joinQueryChainHOF((0, pqb_internal.getPrimaryKeys)(query), reverseJoin, (joiningQuery, baseQuery) => joinQuery(joiningQuery, (0, pqb_internal.getQueryAs)(baseQuery), (0, pqb_internal.getQueryAs)(joiningQuery), {
|
|
1149
1149
|
...joiningQuery.q.joinedShapes,
|
|
1150
|
-
[baseQuery.q.as || baseQuery.table]: baseQuery.q.
|
|
1150
|
+
[baseQuery.q.as || baseQuery.table]: baseQuery.q.selectShape
|
|
1151
1151
|
})),
|
|
1152
1152
|
reverseJoin,
|
|
1153
1153
|
modifyRelatedQuery(relationQuery) {
|
|
@@ -1419,7 +1419,7 @@ const applyRelation = (table, qb, { relationName, relation, dbTable, otherDbTabl
|
|
|
1419
1419
|
else (0, pqb_internal._queryTakeOptional)(query);
|
|
1420
1420
|
query.q.returnsOne = true;
|
|
1421
1421
|
}
|
|
1422
|
-
if (data.virtualColumn) dbTable.shape[relationName] = dbTable.q.
|
|
1422
|
+
if (data.virtualColumn) dbTable.shape[relationName] = dbTable.q.selectShape[relationName] = data.virtualColumn;
|
|
1423
1423
|
baseQuery.joinQuery = data.joinQuery;
|
|
1424
1424
|
const { join: originalJoin } = baseQuery;
|
|
1425
1425
|
baseQuery.join = function(...args) {
|