prisma-sql 1.75.1 → 1.75.2
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 +1 -34
- package/dist/generator.cjs.map +1 -1
- package/dist/generator.js +1 -34
- package/dist/generator.js.map +1 -1
- package/dist/index.cjs +0 -33
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +0 -33
- 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.75.
|
|
2326
|
+
version: "1.75.2",
|
|
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",
|
|
@@ -8082,38 +8082,6 @@ Available fields: ${[...scalarSet].join(", ")}`
|
|
|
8082
8082
|
assertScalarField(model, f, "distinct");
|
|
8083
8083
|
}
|
|
8084
8084
|
}
|
|
8085
|
-
function validateOrderBy(model, orderBy, schemas) {
|
|
8086
|
-
if (!isNotNullish(orderBy)) return;
|
|
8087
|
-
const expanded = expandOrderByInput(orderBy);
|
|
8088
|
-
if (expanded.length === 0) return;
|
|
8089
|
-
const scalarSet = getScalarFieldSet(model);
|
|
8090
|
-
const relationSet = getRelationFieldSet(model);
|
|
8091
|
-
for (const [fieldName, value] of expanded) {
|
|
8092
|
-
const f = String(fieldName).trim();
|
|
8093
|
-
if (f.length === 0) {
|
|
8094
|
-
throw new Error("orderBy field name cannot be empty");
|
|
8095
|
-
}
|
|
8096
|
-
if (f.length > 255) {
|
|
8097
|
-
throw new Error(
|
|
8098
|
-
`orderBy field name too long (${f.length} chars, max 255): ${f.slice(0, 50)}...`
|
|
8099
|
-
);
|
|
8100
|
-
}
|
|
8101
|
-
if (scalarSet.has(f)) {
|
|
8102
|
-
assertScalarField(model, f, "orderBy");
|
|
8103
|
-
continue;
|
|
8104
|
-
}
|
|
8105
|
-
if (relationSet.has(f)) {
|
|
8106
|
-
if (!isPlainObject(value)) {
|
|
8107
|
-
throw new Error(`Relation orderBy for '${f}' must be an object`);
|
|
8108
|
-
}
|
|
8109
|
-
continue;
|
|
8110
|
-
}
|
|
8111
|
-
throw new Error(
|
|
8112
|
-
`orderBy field '${f}' does not exist on model ${model.name}.
|
|
8113
|
-
Available fields: ${[...scalarSet].join(", ")}`
|
|
8114
|
-
);
|
|
8115
|
-
}
|
|
8116
|
-
}
|
|
8117
8085
|
function validateCursor(model, cursor, distinct) {
|
|
8118
8086
|
if (!isNotNullish(cursor)) return;
|
|
8119
8087
|
if (!isPlainObject(cursor)) {
|
|
@@ -8261,7 +8229,6 @@ function buildSelectSql(input) {
|
|
|
8261
8229
|
const argsForSql = normalizeArgsForNegativeTake(method, args);
|
|
8262
8230
|
const normalizedArgs = normalizeArgsForDialect(dialectToUse, argsForSql);
|
|
8263
8231
|
validateDistinct(model, normalizedArgs.distinct);
|
|
8264
|
-
validateOrderBy(model, normalizedArgs.orderBy);
|
|
8265
8232
|
validateCursor(model, normalizedArgs.cursor, normalizedArgs.distinct);
|
|
8266
8233
|
const spec = buildSelectSpec({
|
|
8267
8234
|
method,
|