MCPcopy Create free account
hub / github.com/OpenRaiser/PaperFlow / _load_json_metadata

Function _load_json_metadata

skills/storage-helper/scripts/db_ops.py:52–64  ·  view source on GitHub ↗

Best-effort parse for JSON object metadata fields stored in SQLite.

(raw: Any)

Source from the content-addressed store, hash-verified

50 because the GUI polls task state while a background pull is committing.
51 Both pragmas are best-effort: WAL is unavailable on some filesystems and for
52 in-memory databases, and failing to set it must not break plain CRUD.
53 """
54 conn = sqlite3.connect(DB_PATH, timeout=_BUSY_TIMEOUT_MS / 1000.0)
55 conn.row_factory = sqlite3.Row
56 try:
57 conn.execute(f"PRAGMA busy_timeout = {_BUSY_TIMEOUT_MS}")
58 conn.execute("PRAGMA journal_mode = WAL")
59 conn.execute("PRAGMA synchronous = NORMAL")
60 except sqlite3.Error:
61 pass
62 return conn
63
64
65@contextmanager
66def connection() -> Iterator[sqlite3.Connection]:
67 """Connection scope that always closes, even when the body raises.

Callers 12

_build_paper_dictFunction · 0.85
save_chat_messageFunction · 0.85
get_chat_sessionFunction · 0.85
get_doc_engagement_statsFunction · 0.85
get_latest_pushFunction · 0.85
get_push_for_dateFunction · 0.85
get_recent_drift_updatesFunction · 0.85
get_push_papersFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected