(input: any, options?: { isolationLevel?: TransactionIsolationLevel })
| 230 | |
| 231 | // implementation |
| 232 | async $transaction(input: any, options?: { isolationLevel?: TransactionIsolationLevel }) { |
| 233 | invariant( |
| 234 | typeof input === 'function' || (Array.isArray(input) && input.every((p) => p.then && p.cb)), |
| 235 | 'Invalid transaction input, expected a function or an array of ZenStackPromise', |
| 236 | ); |
| 237 | if (typeof input === 'function') { |
| 238 | return this.interactiveTransaction(input, options); |
| 239 | } else { |
| 240 | return this.sequentialTransaction(input, options); |
| 241 | } |
| 242 | } |
| 243 | |
| 244 | forceTransaction() { |
| 245 | if (!this.kysely.isTransaction) { |
no test coverage detected