MCPcopy Create free account
hub / github.com/internetarchive/openlibrary / read_docs

Function read_docs

openlibrary/data/db.py:135–148  ·  view source on GitHub ↗

Read the docs the docs from DB.

(keys, for_update=False)

Source from the content-addressed store, hash-verified

133
134
135def read_docs(keys, for_update=False):
136 """Read the docs the docs from DB."""
137 if not keys:
138 return []
139
140 debug("BEGIN SELECT")
141 q = "SELECT thing.id, thing.key, thing.latest_revision as revision FROM thing WHERE key IN $keys"
142 if for_update:
143 q += " FOR UPDATE"
144 docs = db.query(q, vars=locals())
145 docs = docs.list()
146 debug("END SELECT")
147 _fill_data(docs)
148 return docs
149
150
151def update_docs(docs, comment, author, ip="127.0.0.1"):

Callers

nothing calls this directly

Calls 3

debugFunction · 0.85
_fill_dataFunction · 0.85
queryMethod · 0.45

Tested by

no test coverage detected