prisma-sql 1.46.0 → 1.48.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 +27 -1
- package/dist/generator.cjs.map +1 -1
- package/dist/generator.js +27 -1
- 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.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",
|
|
@@ -4817,6 +4817,27 @@ function normalizeValue(value: unknown, seen = new WeakSet<object>(), depth = 0)
|
|
|
4817
4817
|
return value
|
|
4818
4818
|
}
|
|
4819
4819
|
|
|
4820
|
+
/**
|
|
4821
|
+
* Get nested value from object using dot notation path
|
|
4822
|
+
*/
|
|
4823
|
+
function getByPath(obj: any, path: string): unknown {
|
|
4824
|
+
if (!obj || !path) return undefined
|
|
4825
|
+
const keys = path.split('.')
|
|
4826
|
+
let result = obj
|
|
4827
|
+
for (const key of keys) {
|
|
4828
|
+
if (result == null) return undefined
|
|
4829
|
+
result = result[key]
|
|
4830
|
+
}
|
|
4831
|
+
return result
|
|
4832
|
+
}
|
|
4833
|
+
|
|
4834
|
+
/**
|
|
4835
|
+
* Normalize all params in array
|
|
4836
|
+
*/
|
|
4837
|
+
function normalizeParams(params: unknown[]): unknown[] {
|
|
4838
|
+
return params.map(p => normalizeValue(p))
|
|
4839
|
+
}
|
|
4840
|
+
|
|
4820
4841
|
|
|
4821
4842
|
export const MODELS: Model[] = ${JSON.stringify(cleanModels, null, 2)}
|
|
4822
4843
|
|
|
@@ -4872,6 +4893,10 @@ function transformEnumValues(modelName: string, obj: any, currentPath: string[]
|
|
|
4872
4893
|
return obj.map(item => transformEnumValues(modelName, item, currentPath))
|
|
4873
4894
|
}
|
|
4874
4895
|
|
|
4896
|
+
if (obj instanceof Date) {
|
|
4897
|
+
return obj
|
|
4898
|
+
}
|
|
4899
|
+
|
|
4875
4900
|
if (typeof obj === 'object') {
|
|
4876
4901
|
const transformed: any = {}
|
|
4877
4902
|
const modelFields = ENUM_FIELDS[modelName] || {}
|
|
@@ -4903,6 +4928,7 @@ function transformEnumValues(modelName: string, obj: any, currentPath: string[]
|
|
|
4903
4928
|
return obj
|
|
4904
4929
|
}
|
|
4905
4930
|
|
|
4931
|
+
|
|
4906
4932
|
function normalizeQuery(args: any): string {
|
|
4907
4933
|
if (!args) return '{}'
|
|
4908
4934
|
|