MCPcopy Create free account
hub / github.com/CodeGraphContext/CodeGraphContext / openDB

Function openDB

website/src/pages/Explore.tsx:73–85  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

71const STORE_NAME = "graphs";
72
73const openDB = (): Promise<IDBDatabase> => {
74 return new Promise((resolve, reject) => {
75 const request = indexedDB.open(DB_NAME, DB_VERSION);
76 request.onerror = () => reject(request.error);
77 request.onsuccess = () => resolve(request.result);
78 request.onupgradeneeded = () => {
79 const db = request.result;
80 if (!db.objectStoreNames.contains(STORE_NAME)) {
81 db.createObjectStore(STORE_NAME, { keyPath: "key" });
82 }
83 };
84 });
85};
86
87const getCachedGraph = async (ref: RepoRef): Promise<any | null> => {
88 try {

Callers 4

getCachedGraphFunction · 0.85
cacheGraphFunction · 0.85
resolveGraphFunction · 0.85
executeToolCallbackFunction · 0.85

Calls 1

resolveFunction · 0.85

Tested by

no test coverage detected