MCPcopy Create free account
hub / github.com/colbymchenry/codegraph / lockDatabase

Function lockDatabase

__tests__/sqlite-open-error.test.ts:87–93  ·  view source on GitHub ↗

* Lock the database from another connection so that no other can read it: * exclusive locking mode, inside a write transaction.

(dbPath: string)

Source from the content-addressed store, hash-verified

85 * exclusive locking mode, inside a write transaction.
86 */
87function lockDatabase(dbPath: string): void {
88 const holder = new DatabaseSync(dbPath);
89 holder.exec('PRAGMA locking_mode = EXCLUSIVE');
90 holder.exec('BEGIN EXCLUSIVE');
91 holder.exec('CREATE TABLE IF NOT EXISTS hold_2795 (x)');
92 cleanups.push(() => { holder.exec('ROLLBACK'); holder.close(); });
93}
94
95function thrownBy(fn: () => unknown): unknown {
96 try {

Callers 1

Calls 3

pushMethod · 0.80
execMethod · 0.65
closeMethod · 0.65

Tested by

no test coverage detected