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/generator.js CHANGED
@@ -2312,7 +2312,7 @@ var require_package = __commonJS({
2312
2312
  "package.json"(exports$1, module) {
2313
2313
  module.exports = {
2314
2314
  name: "prisma-sql",
2315
- version: "1.73.0",
2315
+ version: "1.74.0",
2316
2316
  description: "Convert Prisma queries to optimized SQL with type safety. 2-7x faster than Prisma Client.",
2317
2317
  main: "dist/index.cjs",
2318
2318
  module: "dist/index.js",
@@ -6869,12 +6869,12 @@ function resolveCountSelect(countSelectRaw, model) {
6869
6869
  return null;
6870
6870
  }
6871
6871
  function buildIncludeColumns(spec) {
6872
- var _a3, _b;
6872
+ var _a3, _b, _c, _d, _e;
6873
6873
  const { select: select2, includes, dialect, model, schemas, from, params } = spec;
6874
6874
  const baseSelect = (select2 != null ? select2 : "").trim();
6875
6875
  let countCols = "";
6876
6876
  let countJoins = [];
6877
- const countSelectRaw = (_b = (_a3 = spec.args) == null ? void 0 : _a3.select) == null ? void 0 : _b[COUNT_SELECT_KEY];
6877
+ 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];
6878
6878
  if (countSelectRaw) {
6879
6879
  const resolvedCountSelect = resolveCountSelect(countSelectRaw, model);
6880
6880
  if (resolvedCountSelect && Object.keys(resolvedCountSelect).length > 0) {
@@ -7009,7 +7009,7 @@ function extractIncludeSpec(args) {
7009
7009
  const includeSpec = {};
7010
7010
  if (args.include && isPlainObject(args.include)) {
7011
7011
  for (const [key, value] of Object.entries(args.include)) {
7012
- if (value !== false) {
7012
+ if (value !== false && key !== COUNT_SELECT_KEY) {
7013
7013
  includeSpec[key] = value;
7014
7014
  }
7015
7015
  }