Skip to content

Commit 97e46f5

Browse files
committed
Merge branch 'bug/#450-bug-database-imports-not-working-ssh-tunnel-limitations' into project/411-LoMa
2 parents 427944c + 1292670 commit 97e46f5

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

edisgo/io/db.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -168,15 +168,16 @@ def engine(path: Path | str = None, ssh: bool = False) -> Engine:
168168
169169
"""
170170

171-
if not ssh:
171+
if path is None:
172172
database_url = "toep.iks.cs.ovgu.de"
173173
return create_engine(
174174
"postgresql+oedialect://:@" f"{database_url}",
175175
echo=False,
176176
)
177177

178178
cred = credentials(path=path)
179-
local_port = ssh_tunnel(cred)
179+
180+
local_port = ssh_tunnel(cred) if ssh else int(cred["--database-port"])
180181

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

0 commit comments

Comments
 (0)