MCPcopy Create free account
hub / github.com/zenstackhq/zenstack / $transaction

Method $transaction

packages/orm/src/client/client-impl.ts:232–242  ·  view source on GitHub ↗
(input: any, options?: { isolationLevel?: TransactionIsolationLevel })

Source from the content-addressed store, hash-verified

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) {

Callers 14

zenstackAdapterFunction · 0.80
handleTransactionMethod · 0.80
typing.test-d.tsFile · 0.80
cli.tsFile · 0.80
raw-sql.test.tsFile · 0.80
procedures.test.tsFile · 0.80
ext-result.test.tsFile · 0.80

Calls 3

sequentialTransactionMethod · 0.95
invariantFunction · 0.90

Tested by

no test coverage detected