mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-25 10:44:24 +00:00
Add the option to specify a schema in the postgres DB, also modify docs (#5640)
This commit is contained in:
parent
0295a22561
commit
de9a39e7c6
2 changed files with 11 additions and 6 deletions
|
@ -464,6 +464,7 @@ def run_server(
|
|||
db_port = os.getenv("DATABASE_PORT")
|
||||
db_user = os.getenv("DATABASE_USER")
|
||||
db_name = os.getenv("DATABASE_NAME")
|
||||
db_schema = os.getenv("DATABASE_SCHEMA")
|
||||
|
||||
token = generate_iam_auth_token(
|
||||
db_host=db_host, db_port=db_port, db_user=db_user
|
||||
|
@ -471,6 +472,9 @@ def run_server(
|
|||
|
||||
# print(f"token: {token}")
|
||||
_db_url = f"postgresql://{db_user}:{token}@{db_host}:{db_port}/{db_name}"
|
||||
if db_schema:
|
||||
_db_url += f"?schema={db_schema}"
|
||||
|
||||
os.environ["DATABASE_URL"] = _db_url
|
||||
|
||||
### DECRYPT ENV VAR ###
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue