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

Function createPluginQueryExecutor

src/services/message/fetch.ts:24–35  ·  view source on GitHub ↗
(sessionId: string)

Source from the content-addressed store, hash-verified

22}
23
24function createPluginQueryExecutor(sessionId: string): AsyncSqlExecutor {
25 const adapter = getDataAdapter()
26 return {
27 all<T>(sql: string, params: unknown[] = []): Promise<T[]> {
28 return adapter.pluginQuery<T>(sessionId, sql, params)
29 },
30 async get<T>(sql: string, params: unknown[] = []): Promise<T | undefined> {
31 const rows = await adapter.pluginQuery<T>(sessionId, sql, params)
32 return rows[0]
33 },
34 }
35}
36
37export class FetchMessageAdapter implements MessageAdapter {
38 async getMessagesBefore(

Callers 5

getMessagesBeforeMethod · 0.85
getMessagesAfterMethod · 0.85
getMessageContextMethod · 0.85
searchMessagesMethod · 0.85
getAllRecentMessagesMethod · 0.85

Calls 1

getDataAdapterFunction · 0.70

Tested by

no test coverage detected