MCPcopy Create free account
hub / github.com/ezyang/ghstack / get

Function get

src/ghstack/cache.py:46–56  ·  view source on GitHub ↗
(domain: str, key: str)

Source from the content-addressed store, hash-verified

44
45
46def get(domain: str, key: str) -> Optional[str]:
47 conn = _db_conn()
48 c = conn.execute(
49 "SELECT value FROM ghstack_cache WHERE domain = ? AND key = ?", (domain, key)
50 )
51 r = c.fetchone()
52 if r is None:
53 return None
54 r = r[0]
55 assert isinstance(r, str)
56 return r
57
58
59def put(domain: str, key: str, value: str) -> None:

Callers

nothing calls this directly

Calls 1

_db_connFunction · 0.85

Tested by

no test coverage detected