MCPcopy Index your code
hub / github.com/ChatLab/ChatLab / isChatSessionDb

Function isChatSessionDb

packages/core/src/query/session-queries.ts:120–125  ·  view source on GitHub ↗
(db: DatabaseAdapter)

Source from the content-addressed store, hash-verified

118 * 通过核心三表(meta/member/message)存在性快速识别
119 */
120export function isChatSessionDb(db: DatabaseAdapter): boolean {
121 const row = db
122 .prepare("SELECT COUNT(*) as cnt FROM sqlite_master WHERE type='table' AND name IN ('meta', 'member', 'message')")
123 .get() as { cnt: number } | undefined
124 return row?.cnt === 3
125}
126
127/**
128 * 读取会话元信息

Callers 9

migrateIfNeededMethod · 0.90
listSessionIdsMethod · 0.90
listAnalysisSessionsFunction · 0.90
tryApplyOwnerProfileFunction · 0.90
computeSessionFactsFunction · 0.90
computeSessionFactsFunction · 0.90

Calls 2

getMethod · 0.65
prepareMethod · 0.65

Tested by

no test coverage detected