prisma-sql 1.73.0 → 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.cjs CHANGED
@@ -4592,12 +4592,12 @@ function resolveCountSelect(countSelectRaw, model) {
4592
4592
  return null;
4593
4593
  }
4594
4594
  function buildIncludeColumns(spec) {
4595
- var _a3, _b;
4595
+ var _a3, _b, _c, _d, _e;
4596
4596
  const { select, includes, dialect, model, schemas, from, params } = spec;
4597
4597
  const baseSelect = (select != null ? select : "").trim();
4598
4598
  let countCols = "";
4599
4599
  let countJoins = [];
4600
- const countSelectRaw = (_b = (_a3 = spec.args) == null ? void 0 : _a3.select) == null ? void 0 : _b[COUNT_SELECT_KEY];
4600
+ const countSelectRaw = (_e = (_b = (_a3 = spec.args) == null ? void 0 : _a3.select) == null ? void 0 : _b[COUNT_SELECT_KEY]) != null ? _e : (_d = (_c = spec.args) == null ? void 0 : _c.include) == null ? void 0 : _d[COUNT_SELECT_KEY];
4601
4601
  if (countSelectRaw) {
4602
4602
  const resolvedCountSelect = resolveCountSelect(countSelectRaw, model);
4603
4603
  if (resolvedCountSelect && Object.keys(resolvedCountSelect).length > 0) {
@@ -4732,7 +4732,7 @@ function extractIncludeSpec(args) {
4732
4732
  const includeSpec = {};
4733
4733
  if (args.include && isPlainObject(args.include)) {
4734
4734
  for (const [key, value] of Object.entries(args.include)) {
4735
- if (value !== false) {
4735
+ if (value !== false && key !== COUNT_SELECT_KEY) {
4736
4736
  includeSpec[key] = value;
4737
4737
  }
4738
4738
  }