You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by GitBox <gi...@apache.org> on 2022/11/29 20:44:45 UTC

[GitHub] [superset] hughhhh commented on a diff in pull request #21912: feat(ssh-tunnelling): Setup SSH Tunneling Commands for Database Connections

hughhhh commented on code in PR #21912:
URL: https://github.com/apache/superset/pull/21912#discussion_r1035267052


##########
superset/models/core.py:
##########
@@ -368,14 +372,41 @@ def get_sqla_engine_with_context(
         schema: Optional[str] = None,
         nullpool: bool = True,
         source: Optional[utils.QuerySource] = None,
+        ssh_tunnel: Optional["SSHTunnel"] = None,
     ) -> Engine:
-        yield self._get_sqla_engine(schema=schema, nullpool=nullpool, source=source)
+        ssh_params = {}
+        if ssh_tunnel:
+            # build with override
+            url = make_url_safe(self.sqlalchemy_uri_decrypted)
+            ssh_tunnel.bind_host = url.host

Review Comment:
   the bind_host and bind_port is coming from the sqla uri representing where on the VPC the database is available



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org