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

Function openWritableDatabase

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

Source from the content-addressed store, hash-verified

14 * 会话索引需要写入数据
15 */
16export function openWritableDatabase(sessionId: string): Database.Database | null {
17 const dbPath = getDbPath(sessionId)
18 try {
19 const db = new Database(dbPath)
20 db.pragma('journal_mode = WAL')
21 return db
22 } catch {
23 return null
24 }
25}
26
27/**
28 * 打开数据库(只读模式,不使用缓存)

Callers 1

withWritableAdapterFunction · 0.90

Calls 2

getDbPathFunction · 0.90
pragmaMethod · 0.65

Tested by

no test coverage detected