pqb 0.24.0 → 0.25.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 +1 -1
package/dist/index.mjs
CHANGED
|
@@ -875,10 +875,10 @@ const processWhere = (ands, ctx, table, query, data, quotedAs) => {
|
|
|
875
875
|
qb.q = getClonedQueryData(query);
|
|
876
876
|
qb.q.and = qb.q.or = void 0;
|
|
877
877
|
qb.q.isSubQuery = true;
|
|
878
|
-
const res =
|
|
878
|
+
const res = resolveSubQueryCallback(qb, data);
|
|
879
879
|
const expr = res instanceof Expression ? res : res.q.expr;
|
|
880
880
|
if (!(res instanceof Expression) && res.q.expr) {
|
|
881
|
-
const q =
|
|
881
|
+
const q = joinSubQuery(table, res);
|
|
882
882
|
q.q.select = [expr];
|
|
883
883
|
ands.push(`(${makeSQL(q, ctx).text})`);
|
|
884
884
|
} else {
|
|
@@ -1452,7 +1452,7 @@ const _joinLateral = (self, type, arg, cb, as) => {
|
|
|
1452
1452
|
const query = arg;
|
|
1453
1453
|
query.q.joinTo = q;
|
|
1454
1454
|
((_c = (_b = query.q).joinedShapes) != null ? _c : _b.joinedShapes = {})[getQueryAs(q)] = q.q.shape;
|
|
1455
|
-
let result =
|
|
1455
|
+
let result = resolveSubQueryCallback(query, cb);
|
|
1456
1456
|
if (relation) {
|
|
1457
1457
|
result = relation.relationConfig.joinQuery(
|
|
1458
1458
|
result,
|
|
@@ -1983,7 +1983,7 @@ const addColumnToShapeFromSelect = (q, arg, shape, query, result, isSubQuery, ke
|
|
|
1983
1983
|
}
|
|
1984
1984
|
};
|
|
1985
1985
|
const maybeUnNameColumn = (column, isSubQuery) => {
|
|
1986
|
-
return isSubQuery && column.data.name ? setColumnData(column, "name", void 0) : column;
|
|
1986
|
+
return isSubQuery && (column == null ? void 0 : column.data.name) ? setColumnData(column, "name", void 0) : column;
|
|
1987
1987
|
};
|
|
1988
1988
|
function _querySelect(q, args) {
|
|
1989
1989
|
if (!args.length) {
|
|
@@ -10694,7 +10694,7 @@ class Db {
|
|
|
10694
10694
|
}
|
|
10695
10695
|
}
|
|
10696
10696
|
[inspect.custom]() {
|
|
10697
|
-
return `
|
|
10697
|
+
return `Query<${this.table}>`;
|
|
10698
10698
|
}
|
|
10699
10699
|
/**
|
|
10700
10700
|
* Use `query` to perform raw SQL queries.
|