Skip to content

Commit

Permalink
Print about connection
Browse files Browse the repository at this point in the history
  • Loading branch information
womullan committed Mar 5, 2024
1 parent dfd6849 commit 70186c2
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions python/lsst/consdb/hinfo.py
Original file line number Diff line number Diff line change
Expand Up @@ -257,11 +257,13 @@ def process_date(day_obs: str) -> None:
dbname = os.environ.get("DB_NAME")
url = ""
if host and passwd and user and dbname:
print(f"Connecting to {host} as {user} to {dbname}")
url = f"postgresql://{user}:{passwd}@{host}/{dbname}"
else:
url = os.environ.get(
"POSTGRES_URL", "postgresql://usdf-butler.slac.stanford.edu:5432/lsstdb1"
)
print("Using POSTGRES_URL {user} {host} {dbname}")
engine = create_engine(url)
metadata_obj = MetaData(schema=f"cdb_{instrument.lower()}")
exposure_table = Table("exposure", metadata_obj, autoload_with=engine)
Expand Down

0 comments on commit 70186c2

Please sign in to comment.