pqb 0.66.4 → 0.66.6

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.mjs CHANGED
@@ -6483,7 +6483,7 @@ const setMutativeQueriesSelectRelationsSqlState = (d, as, rel) => {
6483
6483
  const handleInsertAndUpdateSelectRelationsSqlState = (ctx, state) => {
6484
6484
  if (state) ctx.topCtx.mutativeQueriesSelectRelationsSqlState = state;
6485
6485
  };
6486
- const handleDeleteSelectRelationsSqlState = (ctx, query, relationSelectState, returning) => {
6486
+ const handleDeleteSelectRelationsSqlState = (ctx, query, relationSelectState) => {
6487
6487
  const selectRelations = relationSelectState?.value;
6488
6488
  if (!selectRelations) return;
6489
6489
  const selectPrimaryKeysQuery = prepareSubQueryForSql(query, _clone(query));
@@ -6491,7 +6491,6 @@ const handleDeleteSelectRelationsSqlState = (ctx, query, relationSelectState, re
6491
6491
  _addToHookSelect(selectPrimaryKeysQuery, primaryKeys, true);
6492
6492
  const { as: cteAs } = moveQueryToCte(ctx, selectPrimaryKeysQuery, void 0, true);
6493
6493
  const relKeys = Object.keys(selectRelations);
6494
- ctx.selectedCount = (returning ? ctx.selectedCount : 0) + relKeys.length;
6495
6494
  const hookSelect = selectPrimaryKeysQuery.q.hookSelect;
6496
6495
  const join = {
6497
6496
  type: "JOIN",
@@ -7381,7 +7380,7 @@ const pushDeleteSql = (ctx, query, q, quotedAs, isSubSql) => {
7381
7380
  if (q.as && query.table !== q.as) ctx.sql.push(quotedAs);
7382
7381
  const relationSelectState = newMutativeQueriesSelectRelationsSqlState(query);
7383
7382
  let returning = makeReturningSql(ctx, query, q, quotedAs, relationSelectState, "Delete", void 0, isSubSql);
7384
- const selectRelations = handleDeleteSelectRelationsSqlState(ctx, query, relationSelectState, returning);
7383
+ const selectRelations = handleDeleteSelectRelationsSqlState(ctx, query, relationSelectState);
7385
7384
  let join = q.join;
7386
7385
  if (selectRelations) {
7387
7386
  returning = (returning ? returning + ", " : "") + selectRelations.addReturning;