MCPcopy
hub / github.com/debpalash/OmniVoice-Studio / db_conn

Function db_conn

backend/core/db.py:22–35  ·  view source on GitHub ↗

Context-managed SQLite connection that commits on clean exit and always closes.

()

Source from the content-addressed store, hash-verified

20
21@contextmanager
22def db_conn():
23 """Context-managed SQLite connection that commits on clean exit and always closes."""
24 conn = get_db()
25 try:
26 yield conn
27 conn.commit()
28 except Exception:
29 try:
30 conn.rollback()
31 except Exception:
32 pass
33 raise
34 finally:
35 conn.close()
36
37
38_BASE_SCHEMA = """

Callers 15

createFunction · 0.90
_update_statusFunction · 0.90
append_eventFunction · 0.90
events_sinceFunction · 0.90
getFunction · 0.90
list_jobsFunction · 0.90
sweep_orphans_on_startupFunction · 0.90
_load_or_create_saltFunction · 0.90
get_hf_tokenFunction · 0.90
set_hf_tokenFunction · 0.90
clear_hf_tokenFunction · 0.90
get_secretFunction · 0.90

Calls 2

get_dbFunction · 0.85
closeMethod · 0.45