prisma-sql 1.39.0 → 1.41.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 +15 -8
- package/dist/generator.cjs.map +1 -1
- package/dist/generator.js +15 -8
- package/dist/generator.js.map +1 -1
- package/dist/index.cjs +56 -59
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +56 -59
- package/dist/index.js.map +1 -1
- package/package.json +3 -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.41.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",
|
|
@@ -129,6 +129,8 @@ var require_package = __commonJS({
|
|
|
129
129
|
"@faker-js/faker": "^10.2.0",
|
|
130
130
|
"@prisma/adapter-better-sqlite3": "^7.2.0",
|
|
131
131
|
"@prisma/adapter-pg": "^7.2.0",
|
|
132
|
+
"@semantic-release/changelog": "^6.0.3",
|
|
133
|
+
"@semantic-release/git": "^10.0.1",
|
|
132
134
|
"@types/better-sqlite3": "^7.6.13",
|
|
133
135
|
"@types/node": "^25.0.10",
|
|
134
136
|
"@vitest/coverage-v8": "4.0.18",
|
|
@@ -292,6 +294,17 @@ var LIMITS = Object.freeze({
|
|
|
292
294
|
MAX_STRING_LENGTH: 1e4
|
|
293
295
|
});
|
|
294
296
|
|
|
297
|
+
// src/utils/normalize-value.ts
|
|
298
|
+
function normalizeValue(value) {
|
|
299
|
+
if (value instanceof Date) {
|
|
300
|
+
return value.toISOString();
|
|
301
|
+
}
|
|
302
|
+
if (Array.isArray(value)) {
|
|
303
|
+
return value.map(normalizeValue);
|
|
304
|
+
}
|
|
305
|
+
return value;
|
|
306
|
+
}
|
|
307
|
+
|
|
295
308
|
// src/sql-builder-dialect.ts
|
|
296
309
|
var globalDialect = "postgres";
|
|
297
310
|
function setGlobalDialect(dialect) {
|
|
@@ -468,7 +481,7 @@ function prepareArrayParam(value, dialect) {
|
|
|
468
481
|
throw new Error("prepareArrayParam requires array value");
|
|
469
482
|
}
|
|
470
483
|
if (dialect === "postgres") {
|
|
471
|
-
return value;
|
|
484
|
+
return value.map(normalizeValue);
|
|
472
485
|
}
|
|
473
486
|
return JSON.stringify(value);
|
|
474
487
|
}
|
|
@@ -2535,12 +2548,6 @@ function validateState(params, mappings, index) {
|
|
|
2535
2548
|
validateMappings(mappings);
|
|
2536
2549
|
assertNextIndexMatches(mappings.length, index);
|
|
2537
2550
|
}
|
|
2538
|
-
function normalizeValue(value) {
|
|
2539
|
-
if (value instanceof Date) {
|
|
2540
|
-
return value.toISOString();
|
|
2541
|
-
}
|
|
2542
|
-
return value;
|
|
2543
|
-
}
|
|
2544
2551
|
function createStoreInternal(startIndex, initialParams = [], initialMappings = []) {
|
|
2545
2552
|
let index = startIndex;
|
|
2546
2553
|
const params = [...initialParams];
|