MCPcopy Create free account
hub / github.com/cloudflare/computer / transactionSync

Method transactionSync

packages/dofs/src/testing.ts:60–70  ·  view source on GitHub ↗
(closure: () => T)

Source from the content-addressed store, hash-verified

58 }
59
60 transactionSync<T>(closure: () => T): T {
61 this.db.exec("BEGIN");
62 try {
63 const result = closure();
64 this.db.exec("COMMIT");
65 return result;
66 } catch (error) {
67 this.db.exec("ROLLBACK");
68 throw error;
69 }
70 }
71
72 close(): void {
73 // StatementSync instances are released when the database closes.

Callers

nothing calls this directly

Calls 1

execMethod · 0.65

Tested by

no test coverage detected