Sequel-ace: Open SSH/socket connection via mysql://

Created on 25 Jun 2020  路  11Comments  路  Source: Sequel-Ace/Sequel-Ace

  • What version of Sequel-Ace are you using? - Sequel Ace 2.0.2, Build 2033
  • What version of macOS are you running on? - MacOS Catalina, 10.15.5
  • What device(s) are you using Sequel-Ace on? - MacBook Pro 16"

I noticed that Sequel Ace will open a connection via URL (mysql://user:pass@host:post/dbname) just like Sequel Pro did. Is there a way to open a socket connection via URL?

Context - I'm writing an add-on for Local by Flywheel to open connections in Sequel Ace because they currently only support Sequel Pro. Local uses sockets for connections so if there's a way to open Sequel ace with this type of connection that would be awesome.

Enhancement PR Welcome

Most helpful comment

This was initially/partially implemented in https://github.com/sequelpro/sequelpro/issues/1681

It would be nice if this could also support SSH query parameters as I suggested in https://github.com/sequelpro/sequelpro/issues/1681#issuecomment-597398812

All 11 comments

Is there a url standard for mysql:// URLs for sockets? Probably not hard to implement, but would like to follow a convention if one exists!

This is the only source I've really found about a standardized URL structure for MySQL database connections. - https://dev.mysql.com/doc/refman/8.0/en/connecting-using-uri-or-key-value-pairs.html

I'm not that familiar with doing this but it looks like Sequel Ace already supports the MySQL protocol. I'm just not sure how adding the socket to that URL would work.

I managed to change the registered app for the mysql URL scheme to a sequel ace instance attached to my debugger. When I ran:

open root@localhost?socket=%2Ftmp%2Fmysql.sock

It get's picked up by handleMySQLConnectWithURL, but doesn't process the socket part, seems to just expect TCP/IP connections.
Screenshot 2020-06-26 at 4 15 01 PM

Looks like we'd just have to parse the queryString then and throw the value into the "socket" key- not too bad?

The one big complication to this whole thing could be #113 though - that may confound testing of this too

This was initially/partially implemented in https://github.com/sequelpro/sequelpro/issues/1681

It would be nice if this could also support SSH query parameters as I suggested in https://github.com/sequelpro/sequelpro/issues/1681#issuecomment-597398812

Yes, this (https://github.com/sequelpro/sequelpro/issues/1681#issuecomment-597398812)!

SSH URL Schema is what I need personally, will that be included in this next release?

Yes, this (https://github.com/sequelpro/sequelpro/issues/1681#issuecomment-597398812)!

SSH URL Schema is what I need personally, will that be included in this next release?

Support for opening URLs in the MySQL URL schema is already supported by the latest App Store release of Sequel Ace.
We support URLs in the structure:
mysql://[user[:password]@][host[:port]][/database]

Support for the mysql+ssh:// ssh URL schema is not currently written, as far as I'm aware, and thus will not be included in the next release of Sequel Ace unless someone writes this code and submits a PR. I would be happy to review such a PR, but don't believe this to be a priority at this time.

As to support for sockets via url, that is not included in the app and likely will not until we resolve socket issues _and_ someone has time to write support for socket URLs.

Support for the mysql+ssh:// ssh URL schema is not currently written, as far as I'm aware, and thus will not be included in the next release of Sequel Ace unless someone writes this code and submits a PR. I would be happy to review such a PR, but don't believe this to be a priority at this time.

I don't have time for a PR right now, but I am passionate enough to add this. I'll have time to do so in 2021. Thanks for the update!

I'll report back on this issue with my PR in 2021. 鈽猴笍

Was this page helpful?
0 / 5 - 0 ratings

Related issues

stychos picture stychos  路  6Comments

netojose picture netojose  路  4Comments

rafmst picture rafmst  路  4Comments

gms8994 picture gms8994  路  6Comments

blakeyman picture blakeyman  路  5Comments