pqb 0.49.0 → 0.49.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.js +30 -6
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +30 -6
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -4076,7 +4076,16 @@ const handleComputed = (q, computeds, column) => {
|
|
|
4076
4076
|
};
|
|
4077
4077
|
const getShapeFromSelect = (q, isSubQuery) => {
|
|
4078
4078
|
const query = q.q;
|
|
4079
|
-
const {
|
|
4079
|
+
const { shape } = query;
|
|
4080
|
+
let select;
|
|
4081
|
+
if (query.selectedComputeds) {
|
|
4082
|
+
select = query.select ? [...query.select] : [];
|
|
4083
|
+
for (const key in query.selectedComputeds) {
|
|
4084
|
+
select.push(...query.selectedComputeds[key].deps);
|
|
4085
|
+
}
|
|
4086
|
+
} else {
|
|
4087
|
+
select = query.select;
|
|
4088
|
+
}
|
|
4080
4089
|
let result;
|
|
4081
4090
|
if (!select) {
|
|
4082
4091
|
if (isSubQuery) {
|
|
@@ -4135,18 +4144,33 @@ const addColumnToShapeFromSelect = (q, arg, shape, query, result, isSubQuery, ke
|
|
|
4135
4144
|
result[key || column] = shape[column];
|
|
4136
4145
|
} else {
|
|
4137
4146
|
const it = query.joinedShapes?.[table]?.[column];
|
|
4138
|
-
if (it)
|
|
4147
|
+
if (it)
|
|
4148
|
+
result[key || column] = mapSubSelectColumn(
|
|
4149
|
+
it,
|
|
4150
|
+
isSubQuery
|
|
4151
|
+
);
|
|
4139
4152
|
}
|
|
4140
4153
|
} else if (arg === "*") {
|
|
4141
4154
|
for (const key2 in shape) {
|
|
4142
|
-
result[key2] =
|
|
4155
|
+
result[key2] = mapSubSelectColumn(
|
|
4156
|
+
shape[key2],
|
|
4157
|
+
isSubQuery
|
|
4158
|
+
);
|
|
4143
4159
|
}
|
|
4144
4160
|
} else {
|
|
4145
|
-
result[key || arg] =
|
|
4161
|
+
result[key || arg] = mapSubSelectColumn(
|
|
4162
|
+
shape[arg],
|
|
4163
|
+
isSubQuery
|
|
4164
|
+
);
|
|
4146
4165
|
}
|
|
4147
4166
|
};
|
|
4148
|
-
const
|
|
4149
|
-
|
|
4167
|
+
const mapSubSelectColumn = (column, isSubQuery) => {
|
|
4168
|
+
if (!isSubQuery || !column || !column.data.name && !column.data.explicitSelect) {
|
|
4169
|
+
return column;
|
|
4170
|
+
}
|
|
4171
|
+
const cloned = Object.create(column);
|
|
4172
|
+
cloned.data = { ...column.data, name: void 0, explicitSelect: void 0 };
|
|
4173
|
+
return cloned;
|
|
4150
4174
|
};
|
|
4151
4175
|
function _querySelect(q, args) {
|
|
4152
4176
|
var _a;
|