MCPcopy Create free account
hub / github.com/ChatLab/ChatLab / openReadonlyDatabase

Function openReadonlyDatabase

apps/desktop/main/worker/query/session/core.ts:30–39  ·  view source on GitHub ↗
(sessionId: string)

Source from the content-addressed store, hash-verified

28 * 打开数据库(只读模式,不使用缓存)
29 */
30export function openReadonlyDatabase(sessionId: string): Database.Database | null {
31 const dbPath = getDbPath(sessionId)
32 try {
33 const db = new Database(dbPath, { readonly: true })
34 db.pragma('journal_mode = WAL')
35 return db
36 } catch {
37 return null
38 }
39}

Callers 3

exportFilterResultToFileFunction · 0.90
withReadonlyAdapterFunction · 0.90
getSegmentMessagesFunction · 0.90

Calls 2

getDbPathFunction · 0.90
pragmaMethod · 0.65

Tested by

no test coverage detected