prisma-sql 1.47.0 → 1.48.1
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 +9 -2
- package/dist/generator.cjs.map +1 -1
- package/dist/generator.js +9 -2
- package/dist/generator.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.48.1",
|
|
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",
|
|
@@ -4893,6 +4893,10 @@ function transformEnumValues(modelName: string, obj: any, currentPath: string[]
|
|
|
4893
4893
|
return obj.map(item => transformEnumValues(modelName, item, currentPath))
|
|
4894
4894
|
}
|
|
4895
4895
|
|
|
4896
|
+
if (obj instanceof Date) {
|
|
4897
|
+
return obj
|
|
4898
|
+
}
|
|
4899
|
+
|
|
4896
4900
|
if (typeof obj === 'object') {
|
|
4897
4901
|
const transformed: any = {}
|
|
4898
4902
|
const modelFields = ENUM_FIELDS[modelName] || {}
|
|
@@ -4903,7 +4907,7 @@ function transformEnumValues(modelName: string, obj: any, currentPath: string[]
|
|
|
4903
4907
|
const enumType = modelFields[key]
|
|
4904
4908
|
|
|
4905
4909
|
if (enumType) {
|
|
4906
|
-
if (value && typeof value === 'object' && !Array.isArray(value)) {
|
|
4910
|
+
if (value && typeof value === 'object' && !Array.isArray(value) && !(value instanceof Date)) {
|
|
4907
4911
|
const transformedOperators: any = {}
|
|
4908
4912
|
for (const [op, opValue] of Object.entries(value)) {
|
|
4909
4913
|
transformedOperators[op] = transformEnumInValue(opValue, enumType)
|
|
@@ -4912,6 +4916,8 @@ function transformEnumValues(modelName: string, obj: any, currentPath: string[]
|
|
|
4912
4916
|
} else {
|
|
4913
4917
|
transformed[key] = transformEnumInValue(value, enumType)
|
|
4914
4918
|
}
|
|
4919
|
+
} else if (value instanceof Date) {
|
|
4920
|
+
transformed[key] = value
|
|
4915
4921
|
} else if (typeof value === 'object' && value !== null) {
|
|
4916
4922
|
transformed[key] = transformEnumValues(modelName, value, newPath)
|
|
4917
4923
|
} else {
|
|
@@ -4924,6 +4930,7 @@ function transformEnumValues(modelName: string, obj: any, currentPath: string[]
|
|
|
4924
4930
|
return obj
|
|
4925
4931
|
}
|
|
4926
4932
|
|
|
4933
|
+
|
|
4927
4934
|
function normalizeQuery(args: any): string {
|
|
4928
4935
|
if (!args) return '{}'
|
|
4929
4936
|
|