Skip to content

Commit

Permalink
Merge pull request #318 from RamiAwar/fix-new-dsn-on-connection-create
Browse files Browse the repository at this point in the history
Use dsn from db object when creating new connection
  • Loading branch information
anthony2261 committed Sep 5, 2024
2 parents 58baa98 + e0cda12 commit a3c40b6
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions backend/dataline/services/connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,8 @@ async def create_connection(
) -> ConnectionOut:
# Check if connection can be established before saving it
db = await self.get_connection_details(dsn)
# get potentially modified dsn (eg. if localhost was replaced with host.docker.internal)
dsn = str(db._engine.url.render_as_string(hide_password=False))
if not connection_type:
connection_type = db.dialect

Expand Down

0 comments on commit a3c40b6

Please sign in to comment.