MCPcopy Create free account
hub / github.com/dylan-sutton-chavez/edge-python / open

Method open

runtime/src/cache/idb.js:14–25  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

12 }
13
14 async open() {
15 this.db = await new Promise((resolve, reject) => {
16 const req = self.indexedDB.open(IDB_NAME, IDB_VER);
17 req.onupgradeneeded = () => {
18 const db = req.result;
19 if (!db.objectStoreNames.contains('cas')) db.createObjectStore('cas');
20 if (!db.objectStoreNames.contains('lockfile')) db.createObjectStore('lockfile');
21 };
22 req.onsuccess = () => resolve(req.result);
23 req.onerror = () => reject(req.error);
24 });
25 }
26
27 _tx(store, mode) {
28 return this.db.transaction(store, mode).objectStore(store);

Callers 1

openCacheFunction · 0.95

Calls 2

resolveFunction · 0.50
containsMethod · 0.45

Tested by

no test coverage detected