mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-07 08:26:10 +00:00
fix(proxy/utils.py): support configuring db schema for non-iam auth db url
This commit is contained in:
parent
0526334d9c
commit
74bfbeb439
2 changed files with 6 additions and 2 deletions
|
|
@ -13197,11 +13197,11 @@
|
|||
"text"
|
||||
],
|
||||
"supports_function_calling": true,
|
||||
"supports_native_streaming": true,
|
||||
"supports_native_streaming": false,
|
||||
"supports_parallel_function_calling": true,
|
||||
"supports_pdf_input": true,
|
||||
"supports_prompt_caching": true,
|
||||
"supports_reasoning": true,
|
||||
"supports_reasoning": false,
|
||||
"supports_response_schema": true,
|
||||
"supports_system_messages": false,
|
||||
"supports_tool_choice": true,
|
||||
|
|
|
|||
|
|
@ -3707,6 +3707,7 @@ def construct_database_url_from_env_vars() -> Optional[str]:
|
|||
database_username = os.getenv("DATABASE_USERNAME")
|
||||
database_password = os.getenv("DATABASE_PASSWORD")
|
||||
database_name = os.getenv("DATABASE_NAME")
|
||||
database_schema = os.getenv("DATABASE_SCHEMA")
|
||||
|
||||
if database_host and database_username and database_name:
|
||||
# Handle the problem of special character escaping in the database URL
|
||||
|
|
@ -3722,6 +3723,9 @@ def construct_database_url_from_env_vars() -> Optional[str]:
|
|||
else:
|
||||
database_url = f"postgresql://{database_username_enc}@{database_host}/{database_name_enc}"
|
||||
|
||||
if database_schema:
|
||||
database_url += f"?schema={database_schema}"
|
||||
|
||||
return database_url
|
||||
|
||||
return None
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue