Skip to content

Commit

Permalink
Merge branch 'bug/#450-bug-database-imports-not-working-ssh-tunnel-li…
Browse files Browse the repository at this point in the history
…mitations' into project/411-LoMa
  • Loading branch information
khelfen committed Feb 11, 2025
2 parents 427944c + 1292670 commit 97e46f5
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions edisgo/io/db.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,15 +168,16 @@ def engine(path: Path | str = None, ssh: bool = False) -> Engine:
"""

if not ssh:
if path is None:
database_url = "toep.iks.cs.ovgu.de"
return create_engine(
"postgresql+oedialect://:@" f"{database_url}",
echo=False,
)

cred = credentials(path=path)
local_port = ssh_tunnel(cred)

local_port = ssh_tunnel(cred) if ssh else int(cred["--database-port"])

return create_engine(
f"postgresql+psycopg2://{cred['POSTGRES_USER']}:"
Expand Down

0 comments on commit 97e46f5

Please sign in to comment.