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

Function load_profiles

scripts/init_user_metadata.py:36–53  ·  view source on GitHub ↗

从数据库加载 profiles

(db_path: str)

Source from the content-addressed store, hash-verified

34
35
36def load_profiles(db_path: str) -> Dict[str, Dict[str, Any]]:
37 """从数据库加载 profiles"""
38 path = Path(db_path)
39 if not path.is_absolute():
40 path = PROJECT_ROOT / db_path
41
42 conn = sqlite3.connect(path)
43 profiles = conn.execute("SELECT user_id, profile_json, version FROM profiles").fetchall()
44 conn.close()
45
46 result = {}
47 for row in profiles:
48 result[row[0]] = {
49 "profile": json.loads(row[1]),
50 "version": row[2],
51 }
52
53 return result
54
55
56def init_user_metadata(

Callers 1

mainFunction · 0.85

Calls 3

fetchallMethod · 0.45
executeMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected