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

Function create_profile

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

Create a new user profile

(user_id: str, profile_json: Dict)

Source from the content-addressed store, hash-verified

534# ============== Profile Operations ==============
535
536def create_profile(user_id: str, profile_json: Dict) -> Optional[int]:
537 """Create a new user profile"""
538 conn = get_connection()
539 cursor = conn.cursor()
540 try:
541 cursor.execute("""
542 INSERT INTO profiles (user_id, profile_json, version)
543 VALUES (?, ?, ?)
544 """, (user_id, json.dumps(profile_json), profile_json.get("version", "0.1")))
545 conn.commit()
546 profile_id = cursor.lastrowid
547 print(f"Profile created with id: {profile_id}")
548 return profile_id
549 except sqlite3.IntegrityError:
550 print(f"Profile already exists for user: {user_id}")
551 return None
552 finally:
553 conn.close()
554
555
556def save_paper(

Callers 11

mainFunction · 0.90
mainFunction · 0.90
test_create_profileMethod · 0.90
test_get_profileMethod · 0.90
test_update_profileMethod · 0.90
db_ops.pyFile · 0.85
cold_startFunction · 0.85
handle_profile_updateMethod · 0.85
create_roleFunction · 0.85

Calls 5

cursorMethod · 0.80
getMethod · 0.80
get_connectionFunction · 0.70
executeMethod · 0.45
closeMethod · 0.45

Tested by 4

test_create_profileMethod · 0.72
test_get_profileMethod · 0.72
test_update_profileMethod · 0.72