[FEATURE] SSH tunnel support
Most databases I want to connect to are only reachable with an SSH tunnel through a bastion server. Some database clients (DBeaver, DataGrip, pgcli off the top of my head) support setting up tunnels in their config and it'd be nice if dblab did as well.
+1 to this. I make use of SequelAce usually but I'd love to have DBLab as an alternative for when I'm in a terminal scenario and don't have a GUI. I was just reviewing all the docs to see if this was supported and can't find any mention of "proxy" "tunnel" or "ssh".
@mhammerly Thanks for bringing this to my attention. Can't promise to work on this right away, because I have other issues with higher priority, but I've been doing my best to address users' requests lately.
whenever you get around to it (if you can at all), thanks! just made an issue to give myself and others a place to subscribe
dblab looks cool, may write a little wrapper script so i can try it out in the meantime!
Really looking forward to have SSH tunneling built in 👍
I am not a golang developer, but I could have a look into this. Would only need to know if there is a good package for it 😉
DBLAB looks really cool. I am really looking forward to have this built in as well 👍🏽
This library should make it easy to add SSH tunneling to DB connections:
- https://github.com/jfcote87/sshdb
Guys, there's a new PR addressing this issue. Please, check it out and let me know if that satisfies your requirements. Sorry if it took so long to arrive.
@danvergara thank you!
i'm able to connect to my database with this feature using the command below and it populates the list of tables, but if i try to run a query or select a table the results window shows an error: read tcp 10.1.1.1:49332->10.2.2.2:22: use of closed network connection
dblab \
--host <redacted> --port 5432 --driver postgres --db postgres --user matt --pass '<redacted>' \
--ssh-host <redacted> --ssh-user matt --ssh-port 22
i don't know golang but from a quick skim of the PR it looks like the SSH connection may be allowed to close after initial startup? https://github.com/danvergara/dblab/pull/246/files#r1904690197
@danvergara thank you!
i'm able to connect to my database with this feature using the command below and it populates the list of tables, but if i try to run a query or select a table the results window shows an error:
read tcp 10.1.1.1:49332->10.2.2.2:22: use of closed network connectiondblab \ --host <redacted> --port 5432 --driver postgres --db postgres --user matt --pass '<redacted>' \ --ssh-host <redacted> --ssh-user matt --ssh-port 22i don't know golang but from a quick skim of the PR it looks like the SSH connection may be allowed to close after initial startup? https://github.com/danvergara/dblab/pull/246/files#r1904690197
Thanks @mhammerly for bringing this to my attention. I put out a new PR to address this issue. Please, check it out.
@mhammerly just merged #249 and released v0.30.1 fixing the bug.