MCPcopy Create free account
hub / github.com/MemTensor/MemOS / getSessionOwnerMap

Method getSessionOwnerMap

packages/memos-core/src/storage/sqlite.ts:2865–2874  ·  view source on GitHub ↗
(sessionKeys: string[])

Source from the content-addressed store, hash-verified

2863 }
2864
2865 getSessionOwnerMap(sessionKeys: string[]): Map<string, string> {
2866 const result = new Map<string, string>();
2867 if (sessionKeys.length === 0) return result;
2868 const placeholders = sessionKeys.map(() => "?").join(",");
2869 const rows = this.db.prepare(
2870 `SELECT session_key, owner FROM chunks WHERE session_key IN (${placeholders}) AND owner IS NOT NULL GROUP BY session_key`,
2871 ).all(...sessionKeys) as Array<{ session_key: string; owner: string }>;
2872 for (const r of rows) result.set(r.session_key, r.owner);
2873 return result;
2874 }
2875
2876 close(): void {
2877 this.db.close();

Callers 1

runPostprocessMethod · 0.45

Calls 5

mapMethod · 0.80
allMethod · 0.80
prepareMethod · 0.80
setMethod · 0.65
joinMethod · 0.45

Tested by

no test coverage detected