(tx: AnyKysely)
| 280 | options?: { isolationLevel?: TransactionIsolationLevel }, |
| 281 | ) { |
| 282 | const execute = async (tx: AnyKysely) => { |
| 283 | const txClient = new ClientImpl(this.schema, this.$options, this); |
| 284 | txClient.kysely = tx; |
| 285 | const result: any[] = []; |
| 286 | for (const promise of arg) { |
| 287 | const cb = this.getPromiseCallback(promise); |
| 288 | result.push(await cb(txClient as unknown as ClientContract<SchemaDef>)); |
| 289 | } |
| 290 | return result; |
| 291 | }; |
| 292 | if (this.kysely.isTransaction) { |
| 293 | // proceed directly if already in a transaction |
| 294 | return execute(this.kysely); |
no test coverage detected