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

Function createSyncExecutor

apps/desktop/main/worker/query/messages.ts:44–55  ·  view source on GitHub ↗
(sessionId: string)

Source from the content-addressed store, hash-verified

42// ==================== Executor adapter ====================
43
44function createSyncExecutor(sessionId: string): AsyncSqlExecutor | null {
45 const db = openDatabase(sessionId)
46 if (!db) return null
47 return {
48 all<T>(sql: string, params: unknown[] = []): Promise<T[]> {
49 return Promise.resolve(db.prepare(sql).all(...params) as T[])
50 },
51 get<T>(sql: string, params: unknown[] = []): Promise<T | undefined> {
52 return Promise.resolve(db.prepare(sql).get(...params) as T | undefined)
53 },
54 }
55}
56
57// ==================== Query functions ====================
58

Callers 9

getRecentMessagesFunction · 0.85
getAllRecentMessagesFunction · 0.85
searchMessagesFunction · 0.85
deepSearchMessagesFunction · 0.85
getMessageContextFunction · 0.85
getSearchMessageContextFunction · 0.85
getMessagesBeforeFunction · 0.85
getMessagesAfterFunction · 0.85
getConversationBetweenFunction · 0.85

Calls 1

openDatabaseFunction · 0.90

Tested by

no test coverage detected