prisma-sql 1.75.10 → 1.75.12
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/collect-planner-stats.cjs +13 -1
- package/dist/collect-planner-stats.cjs.map +1 -1
- package/dist/collect-planner-stats.js +13 -1
- package/dist/collect-planner-stats.js.map +1 -1
- package/dist/generator.cjs +11 -2
- package/dist/generator.cjs.map +1 -1
- package/dist/generator.js +11 -2
- package/dist/generator.js.map +1 -1
- package/package.json +2 -1
package/dist/generator.js
CHANGED
|
@@ -68,7 +68,7 @@ var require_package = __commonJS({
|
|
|
68
68
|
"package.json"(exports$1, module) {
|
|
69
69
|
module.exports = {
|
|
70
70
|
name: "prisma-sql",
|
|
71
|
-
version: "1.75.
|
|
71
|
+
version: "1.75.12",
|
|
72
72
|
description: "Convert Prisma queries to optimized SQL with type safety. 2-7x faster than Prisma Client.",
|
|
73
73
|
main: "dist/index.cjs",
|
|
74
74
|
module: "dist/index.js",
|
|
@@ -137,6 +137,7 @@ var require_package = __commonJS({
|
|
|
137
137
|
"@dee-wan/schema-parser": "1.4.0",
|
|
138
138
|
"@prisma/generator-helper": "^7.4.0",
|
|
139
139
|
"@prisma/internals": "^7.4.0",
|
|
140
|
+
dotenv: "^17.3.1",
|
|
140
141
|
postgres: "^3.4.8"
|
|
141
142
|
},
|
|
142
143
|
devDependencies: {
|
|
@@ -7853,6 +7854,8 @@ function generateExtension(runtimeImportPath) {
|
|
|
7853
7854
|
postgresClient: postgres,
|
|
7854
7855
|
})
|
|
7855
7856
|
|
|
7857
|
+
const originalTransaction = prisma.$transaction.bind(prisma)
|
|
7858
|
+
|
|
7856
7859
|
interface ModelContext {
|
|
7857
7860
|
name?: string
|
|
7858
7861
|
$name?: string
|
|
@@ -8257,9 +8260,15 @@ function generateExtension(runtimeImportPath) {
|
|
|
8257
8260
|
}
|
|
8258
8261
|
|
|
8259
8262
|
async function transaction(
|
|
8260
|
-
|
|
8263
|
+
queriesOrFn: TransactionQuery[] | any[] | ((...args: any[]) => Promise<any>),
|
|
8261
8264
|
options?: TransactionOptions,
|
|
8262
8265
|
): Promise<unknown[]> {
|
|
8266
|
+
if (typeof queriesOrFn === 'function') {
|
|
8267
|
+
return originalTransaction(queriesOrFn, options)
|
|
8268
|
+
}
|
|
8269
|
+
|
|
8270
|
+
const queries = queriesOrFn
|
|
8271
|
+
|
|
8263
8272
|
if (!queries || queries.length === 0) {
|
|
8264
8273
|
return []
|
|
8265
8274
|
}
|