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.cjs +4 -4
- package/dist/generator.cjs.map +1 -1
- package/dist/generator.js +4 -4
- package/dist/generator.js.map +1 -1
- package/dist/index.cjs +3 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +3 -3
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/generator.cjs
CHANGED
|
@@ -2323,7 +2323,7 @@ var require_package = __commonJS({
|
|
|
2323
2323
|
"package.json"(exports$1, module) {
|
|
2324
2324
|
module.exports = {
|
|
2325
2325
|
name: "prisma-sql",
|
|
2326
|
-
version: "1.
|
|
2326
|
+
version: "1.74.0",
|
|
2327
2327
|
description: "Convert Prisma queries to optimized SQL with type safety. 2-7x faster than Prisma Client.",
|
|
2328
2328
|
main: "dist/index.cjs",
|
|
2329
2329
|
module: "dist/index.js",
|
|
@@ -6880,12 +6880,12 @@ function resolveCountSelect(countSelectRaw, model) {
|
|
|
6880
6880
|
return null;
|
|
6881
6881
|
}
|
|
6882
6882
|
function buildIncludeColumns(spec) {
|
|
6883
|
-
var _a3, _b;
|
|
6883
|
+
var _a3, _b, _c, _d, _e;
|
|
6884
6884
|
const { select: select2, includes, dialect, model, schemas, from, params } = spec;
|
|
6885
6885
|
const baseSelect = (select2 != null ? select2 : "").trim();
|
|
6886
6886
|
let countCols = "";
|
|
6887
6887
|
let countJoins = [];
|
|
6888
|
-
const countSelectRaw = (_b = (_a3 = spec.args) == null ? void 0 : _a3.select) == null ? void 0 : _b[COUNT_SELECT_KEY];
|
|
6888
|
+
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];
|
|
6889
6889
|
if (countSelectRaw) {
|
|
6890
6890
|
const resolvedCountSelect = resolveCountSelect(countSelectRaw, model);
|
|
6891
6891
|
if (resolvedCountSelect && Object.keys(resolvedCountSelect).length > 0) {
|
|
@@ -7020,7 +7020,7 @@ function extractIncludeSpec(args) {
|
|
|
7020
7020
|
const includeSpec = {};
|
|
7021
7021
|
if (args.include && isPlainObject(args.include)) {
|
|
7022
7022
|
for (const [key, value] of Object.entries(args.include)) {
|
|
7023
|
-
if (value !== false) {
|
|
7023
|
+
if (value !== false && key !== COUNT_SELECT_KEY) {
|
|
7024
7024
|
includeSpec[key] = value;
|
|
7025
7025
|
}
|
|
7026
7026
|
}
|