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