prisma-sql 1.75.0 → 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 -35
- package/dist/generator.cjs.map +1 -1
- package/dist/generator.js +1 -35
- package/dist/generator.js.map +1 -1
- package/dist/index.cjs +0 -34
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +0 -34
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
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.75.
|
|
2315
|
+
version: "1.75.2",
|
|
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",
|
|
@@ -8071,39 +8071,6 @@ Available fields: ${[...scalarSet].join(", ")}`
|
|
|
8071
8071
|
assertScalarField(model, f, "distinct");
|
|
8072
8072
|
}
|
|
8073
8073
|
}
|
|
8074
|
-
function validateOrderBy(model, orderBy, schemas) {
|
|
8075
|
-
if (!isNotNullish(orderBy)) return;
|
|
8076
|
-
const expanded = expandOrderByInput(orderBy);
|
|
8077
|
-
if (expanded.length === 0) return;
|
|
8078
|
-
const scalarSet = getScalarFieldSet(model);
|
|
8079
|
-
const relationSet = getRelationFieldSet(model);
|
|
8080
|
-
for (const [fieldName, value] of expanded) {
|
|
8081
|
-
const f = String(fieldName).trim();
|
|
8082
|
-
if (f.length === 0) {
|
|
8083
|
-
throw new Error("orderBy field name cannot be empty");
|
|
8084
|
-
}
|
|
8085
|
-
if (f.length > 255) {
|
|
8086
|
-
throw new Error(
|
|
8087
|
-
`orderBy field name too long (${f.length} chars, max 255): ${f.slice(0, 50)}...`
|
|
8088
|
-
);
|
|
8089
|
-
}
|
|
8090
|
-
if (scalarSet.has(f)) {
|
|
8091
|
-
assertScalarField(model, f, "orderBy");
|
|
8092
|
-
parseOrderByValue(value, f);
|
|
8093
|
-
continue;
|
|
8094
|
-
}
|
|
8095
|
-
if (relationSet.has(f)) {
|
|
8096
|
-
if (!isPlainObject(value)) {
|
|
8097
|
-
throw new Error(`Relation orderBy for '${f}' must be an object`);
|
|
8098
|
-
}
|
|
8099
|
-
continue;
|
|
8100
|
-
}
|
|
8101
|
-
throw new Error(
|
|
8102
|
-
`orderBy field '${f}' does not exist on model ${model.name}.
|
|
8103
|
-
Available fields: ${[...scalarSet].join(", ")}`
|
|
8104
|
-
);
|
|
8105
|
-
}
|
|
8106
|
-
}
|
|
8107
8074
|
function validateCursor(model, cursor, distinct) {
|
|
8108
8075
|
if (!isNotNullish(cursor)) return;
|
|
8109
8076
|
if (!isPlainObject(cursor)) {
|
|
@@ -8251,7 +8218,6 @@ function buildSelectSql(input) {
|
|
|
8251
8218
|
const argsForSql = normalizeArgsForNegativeTake(method, args);
|
|
8252
8219
|
const normalizedArgs = normalizeArgsForDialect(dialectToUse, argsForSql);
|
|
8253
8220
|
validateDistinct(model, normalizedArgs.distinct);
|
|
8254
|
-
validateOrderBy(model, normalizedArgs.orderBy);
|
|
8255
8221
|
validateCursor(model, normalizedArgs.cursor, normalizedArgs.distinct);
|
|
8256
8222
|
const spec = buildSelectSpec({
|
|
8257
8223
|
method,
|