prisma-sql 1.43.0 → 1.44.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 +13 -6
- package/dist/generator.cjs.map +1 -1
- package/dist/generator.js +13 -6
- package/dist/generator.js.map +1 -1
- package/dist/index.cjs +12 -5
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +12 -5
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/generator.cjs
CHANGED
|
@@ -56,7 +56,7 @@ var require_package = __commonJS({
|
|
|
56
56
|
"package.json"(exports$1, module) {
|
|
57
57
|
module.exports = {
|
|
58
58
|
name: "prisma-sql",
|
|
59
|
-
version: "1.
|
|
59
|
+
version: "1.44.0",
|
|
60
60
|
description: "Convert Prisma queries to optimized SQL with type safety. 2-7x faster than Prisma Client.",
|
|
61
61
|
main: "dist/index.cjs",
|
|
62
62
|
module: "dist/index.js",
|
|
@@ -3377,6 +3377,9 @@ function buildRelationCountSql(countSelect, model, schemas, parentAlias, _params
|
|
|
3377
3377
|
|
|
3378
3378
|
// src/builder/select/assembly.ts
|
|
3379
3379
|
var SIMPLE_SELECT_RE_CACHE = /* @__PURE__ */ new Map();
|
|
3380
|
+
function normalizeFinalParams(params) {
|
|
3381
|
+
return params.map(normalizeValue);
|
|
3382
|
+
}
|
|
3380
3383
|
function joinNonEmpty(parts, sep) {
|
|
3381
3384
|
return parts.filter((s) => s.trim().length > 0).join(sep);
|
|
3382
3385
|
}
|
|
@@ -3403,8 +3406,8 @@ function finalizeSql(sql, params) {
|
|
|
3403
3406
|
validateParamConsistency(sql, snapshot.params);
|
|
3404
3407
|
return Object.freeze({
|
|
3405
3408
|
sql,
|
|
3406
|
-
params: snapshot.params,
|
|
3407
|
-
paramMappings: snapshot.mappings
|
|
3409
|
+
params: normalizeFinalParams(snapshot.params),
|
|
3410
|
+
paramMappings: Object.freeze(snapshot.mappings)
|
|
3408
3411
|
});
|
|
3409
3412
|
}
|
|
3410
3413
|
function parseSimpleScalarSelect(select, alias) {
|
|
@@ -3898,6 +3901,9 @@ var COMPARISON_OPS = {
|
|
|
3898
3901
|
[Ops.LT]: "<",
|
|
3899
3902
|
[Ops.LTE]: "<="
|
|
3900
3903
|
};
|
|
3904
|
+
function normalizeFinalParams2(params) {
|
|
3905
|
+
return params.map(normalizeValue);
|
|
3906
|
+
}
|
|
3901
3907
|
function getModelFieldMap(model) {
|
|
3902
3908
|
const cached = MODEL_FIELD_CACHE.get(model);
|
|
3903
3909
|
if (cached) return cached;
|
|
@@ -4254,7 +4260,7 @@ function buildAggregateSql(args, whereResult, tableName, alias, model) {
|
|
|
4254
4260
|
validateParamConsistency(sql, whereResult.params);
|
|
4255
4261
|
return Object.freeze({
|
|
4256
4262
|
sql,
|
|
4257
|
-
params: Object.freeze([...whereResult.params]),
|
|
4263
|
+
params: Object.freeze(normalizeFinalParams2([...whereResult.params])),
|
|
4258
4264
|
paramMappings: Object.freeze([...whereResult.paramMappings])
|
|
4259
4265
|
});
|
|
4260
4266
|
}
|
|
@@ -4325,9 +4331,10 @@ function buildGroupBySql(args, whereResult, tableName, alias, model, dialect) {
|
|
|
4325
4331
|
const snapshot = params.snapshot();
|
|
4326
4332
|
validateSelectQuery(sql);
|
|
4327
4333
|
validateParamConsistency(sql, [...whereResult.params, ...snapshot.params]);
|
|
4334
|
+
const mergedParams = [...whereResult.params, ...snapshot.params];
|
|
4328
4335
|
return Object.freeze({
|
|
4329
4336
|
sql,
|
|
4330
|
-
params: Object.freeze(
|
|
4337
|
+
params: Object.freeze(normalizeFinalParams2(mergedParams)),
|
|
4331
4338
|
paramMappings: Object.freeze([
|
|
4332
4339
|
...whereResult.paramMappings,
|
|
4333
4340
|
...snapshot.mappings
|
|
@@ -4366,7 +4373,7 @@ function buildCountSql(whereResult, tableName, alias, skip, dialect) {
|
|
|
4366
4373
|
validateParamConsistency(sql, mergedParams);
|
|
4367
4374
|
return Object.freeze({
|
|
4368
4375
|
sql,
|
|
4369
|
-
params: Object.freeze(mergedParams),
|
|
4376
|
+
params: Object.freeze(normalizeFinalParams2(mergedParams)),
|
|
4370
4377
|
paramMappings: Object.freeze([
|
|
4371
4378
|
...whereResult.paramMappings,
|
|
4372
4379
|
...snapshot.mappings
|