prisma-sql 1.75.11 → 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/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.11",
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",
@@ -144,7 +144,6 @@ var require_package = __commonJS({
144
144
  "@faker-js/faker": "^10.2.0",
145
145
  "@prisma/adapter-better-sqlite3": "^7.4.0",
146
146
  "@prisma/adapter-pg": "^7.4.0",
147
- "@prisma/client": "7.4.0",
148
147
  "@semantic-release/changelog": "^6.0.3",
149
148
  "@semantic-release/git": "^10.0.1",
150
149
  "@types/better-sqlite3": "^7.6.13",
@@ -153,11 +152,12 @@ var require_package = __commonJS({
153
152
  "better-sqlite3": "^12.6.2",
154
153
  "drizzle-kit": "^0.31.8",
155
154
  "drizzle-orm": "^0.45.1",
156
- prisma: "7.4.0",
157
155
  tsup: "^8.5.1",
158
156
  tsx: "^4.21.0",
159
157
  typescript: "^5.9.3",
160
- vitest: "^4.0.18"
158
+ vitest: "^4.0.18",
159
+ "@prisma/client": "7.4.0",
160
+ prisma: "7.4.0"
161
161
  },
162
162
  engines: {
163
163
  node: ">=16.0.0"
@@ -7854,6 +7854,8 @@ function generateExtension(runtimeImportPath) {
7854
7854
  postgresClient: postgres,
7855
7855
  })
7856
7856
 
7857
+ const originalTransaction = prisma.$transaction.bind(prisma)
7858
+
7857
7859
  interface ModelContext {
7858
7860
  name?: string
7859
7861
  $name?: string
@@ -8258,9 +8260,15 @@ function generateExtension(runtimeImportPath) {
8258
8260
  }
8259
8261
 
8260
8262
  async function transaction(
8261
- queries: TransactionQuery[] | any[],
8263
+ queriesOrFn: TransactionQuery[] | any[] | ((...args: any[]) => Promise<any>),
8262
8264
  options?: TransactionOptions,
8263
8265
  ): Promise<unknown[]> {
8266
+ if (typeof queriesOrFn === 'function') {
8267
+ return originalTransaction(queriesOrFn, options)
8268
+ }
8269
+
8270
+ const queries = queriesOrFn
8271
+
8264
8272
  if (!queries || queries.length === 0) {
8265
8273
  return []
8266
8274
  }