MCPcopy Create free account
hub / github.com/IgorWarzocha/howcode / runInTransaction

Function runInTransaction

desktop/thread-state-db/write-transaction.ts:3–13  ·  view source on GitHub ↗
(db: Database, operation: () => void)

Source from the content-addressed store, hash-verified

1import type Database from 'better-sqlite3'
2
3export function runInTransaction(db: Database, operation: () => void) {
4 db.exec('BEGIN')
5
6 try {
7 operation()
8 db.exec('COMMIT')
9 } catch (error) {
10 db.exec('ROLLBACK')
11 throw error
12 }
13}

Callers 6

updateArchivedFlagFunction · 0.90
reorderProjectsFunction · 0.90
syncSessionSummariesFunction · 0.90
beginInboxThreadTurnFunction · 0.90

Calls 1

execMethod · 0.80

Tested by

no test coverage detected