Add the option to specify a schema in the postgres DB, also modify docs (#5640)

This commit is contained in:
steffen-sbt 2024-09-11 22:53:52 +01:00 committed by GitHub
parent 0295a22561
commit de9a39e7c6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 11 additions and 6 deletions

View file

@ -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 ###