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

Function renameSession

apps/desktop/main/database/core.ts:187–202  ·  view source on GitHub ↗
(sessionId: string, newName: string)

Source from the content-addressed store, hash-verified

185 * 重命名会话
186 */
187export function renameSession(sessionId: string, newName: string): boolean {
188 const dbPath = getDbPath(sessionId)
189 if (!fs.existsSync(dbPath)) return false
190
191 const db = new Database(dbPath)
192 db.pragma('journal_mode = WAL')
193 try {
194 coreRenameSession(new BetterSqliteAdapter(db), newName)
195 return true
196 } catch (error) {
197 console.error('[Database] Failed to rename session:', error)
198 return false
199 } finally {
200 db.close()
201 }
202}
203
204/**
205 * 获取数据库存储目录

Callers

nothing calls this directly

Calls 4

getDbPathFunction · 0.70
pragmaMethod · 0.65
errorMethod · 0.65
closeMethod · 0.65

Tested by

no test coverage detected