Skip to content

Commit

Permalink
Merge pull request #39 from shuhaib-aot/formsflow
Browse files Browse the repository at this point in the history
Added database env for constructing db url
  • Loading branch information
shuhaib-aot authored Oct 7, 2024
2 parents 3d3d465 + 856bd08 commit dd3b78e
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions redash/settings/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,14 @@
STATSD_USE_TAGS = parse_boolean(os.environ.get("REDASH_STATSD_USE_TAGS", "false"))

# Connection settings for Redash's own database (where we store the queries, results, etc)
SQLALCHEMY_DATABASE_URI = os.environ.get(
"REDASH_DATABASE_URL", os.environ.get("DATABASE_URL", "postgresql:///postgres")
)
DB_USER = os.getenv("DATABASE_USERNAME", "postgres")
DB_PASSWORD = os.getenv("DATABASE_PASSWORD", "postgres")
DB_HOST = os.getenv("DATABASE_HOST", "localhost")
DB_PORT = os.getenv("DATABASE_PORT", "6432")
DB_NAME = os.getenv("DATABASE_NAME", "postgres")
database_default_url = os.environ.get("DATABASE_URL", f"postgresql://{DB_USER}:{DB_PASSWORD}@{DB_HOST}:{DB_PORT}/{DB_NAME}")
SQLALCHEMY_DATABASE_URI = os.getenv("REDASH_DATABASE_URL", database_default_url)

SQLALCHEMY_MAX_OVERFLOW = int_or_none(os.environ.get("SQLALCHEMY_MAX_OVERFLOW"))
SQLALCHEMY_POOL_SIZE = int_or_none(os.environ.get("SQLALCHEMY_POOL_SIZE"))
SQLALCHEMY_DISABLE_POOL = parse_boolean(os.environ.get("SQLALCHEMY_DISABLE_POOL", "false"))
Expand Down

0 comments on commit dd3b78e

Please sign in to comment.