MCPcopy Create free account
hub / github.com/Tron521/codex-console-temp / get_db

Function get_db

src/database/session.py:375–384  ·  view source on GitHub ↗

获取数据库会话的快捷函数

()

Source from the content-addressed store, hash-verified

373
374@contextmanager
375def get_db() -> Generator[Session, None, None]:
376 """
377 获取数据库会话的快捷函数
378 """
379 manager = get_session_manager()
380 db = manager.SessionLocal()
381 try:
382 yield db
383 finally:
384 db.close()

Callers 15

_logMethod · 0.85
save_to_databaseMethod · 0.85
_load_stateFunction · 0.85
_save_stateFunction · 0.85
_check_accounts_authFunction · 0.85
_check_payment_pipelineFunction · 0.85
_check_data_consistencyFunction · 0.85
create_selfcheck_runFunction · 0.85

Calls 2

get_session_managerFunction · 0.85
closeMethod · 0.45

Tested by 7

test_email_serviceFunction · 0.68
test_proxy_itemFunction · 0.68
test_all_proxiesFunction · 0.68
test_codex2api_serviceFunction · 0.68
test_sub2api_serviceFunction · 0.68
test_cpa_serviceFunction · 0.68
test_new_api_serviceFunction · 0.68