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

Function get_database_pool_settings

src/database/session.py:54–71  ·  view source on GitHub ↗
(database_url: str)

Source from the content-addressed store, hash-verified

52
53
54def get_database_pool_settings(database_url: str) -> Dict[str, Any]:
55 backend = get_database_backend(database_url)
56 settings: Dict[str, Any] = {
57 "backend": backend,
58 "pool_pre_ping": _get_env_bool("APP_DB_POOL_PRE_PING", True),
59 }
60 if backend == "sqlite":
61 settings["sqlite_check_same_thread"] = False
62 return settings
63
64 settings.update({
65 "pool_size": _get_env_int("APP_DB_POOL_SIZE", 20, 1),
66 "max_overflow": _get_env_int("APP_DB_MAX_OVERFLOW", 20, 0),
67 "pool_timeout": _get_env_int("APP_DB_POOL_TIMEOUT", 30, 1),
68 "pool_recycle": _get_env_int("APP_DB_POOL_RECYCLE", 1800, 30),
69 "pool_use_lifo": _get_env_bool("APP_DB_POOL_USE_LIFO", True),
70 })
71 return settings
72
73
74def _build_engine_options(database_url: str) -> Dict[str, Any]:

Callers 3

setup_applicationFunction · 0.90
_build_engine_optionsFunction · 0.85
get_database_infoFunction · 0.85

Calls 3

get_database_backendFunction · 0.85
_get_env_boolFunction · 0.85
_get_env_intFunction · 0.85

Tested by

no test coverage detected