Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Maybe fallback to Sequel Pro #14

Open
aubreypwd opened this issue Oct 29, 2021 · 6 comments
Open

Maybe fallback to Sequel Pro #14

aubreypwd opened this issue Oct 29, 2021 · 6 comments
Assignees
Labels
enhancement New feature or request

Comments

@aubreypwd
Copy link
Owner

aubreypwd commented Oct 29, 2021

See https://community.localwp.com/t/sequel-pro-add-on/27380/2 for context.

The idea here is that if you don't have TablePlus installed, but you do have Sequel Pro installed (and I can just switch out the App that is launched to Sequel Pro and it works the same way) maybe a secret functionality of the addon could fallback to Sequel Pro (Nightly) if you have it installed.

  • It would have to connect the same way: e.g. I fire up Sequel Pro and it uses /tmp/mysql.sock to connect by default (if it doesn't do this, I likely won't commit to this)
  • It would have to be an easy fallback to code in (if it's too hard, I don't use Sequel Pro, so I don't want to commit both time and maintenance to it)

But, if it can be done easily, I'm happy to try.

@aubreypwd aubreypwd self-assigned this Oct 29, 2021
@aubreypwd aubreypwd added the enhancement New feature or request label Oct 29, 2021
@aubreypwd
Copy link
Owner Author

Noteable Information: https://community.localwp.com/t/add-back-sequel-pro-support/27272/13

Honestly, I tried. I actually created an issue about the sandboxing socket issue a little over a year ago (Sequel-Ace/Sequel-Ace#108 3). Unfortunately, it doesn’t look like there’s a good path forward at this point. @afragen, if you have any ideas, I’d be happy to look into it.

@afragen
Copy link

afragen commented Oct 29, 2021

Thanks for looking into this. Sequel PRO nightly does work using the socket.

@aubreypwd
Copy link
Owner Author

aubreypwd commented Oct 29, 2021

Sequel PRO nightly does work using the socket.

How this addon works is it symlinks /tmp/mysql.sock to the mysql.sock file in Local for the site, it then uses macOS open to open a mysql:// protocol URL to /tmp/mysql.sock which should connect to the Local site.

What needs to happen here is I need to be able to do the same thing but

  1. SequelPro needs to become the default for the mysql:// protocol
  2. When I run the mysql:// command with open Sequel Pro needs to connect to it and load the DB

If it will operate that way it's easy for SequelPro to be the fallback, since it is just the App that responds to the mysql:// call and all I have to do is

  1. Replace the "Open TablePlus" with "Open Sequel Pro"
  2. Allow the button to show if you have Sequel Pro installed

I am wondering if macOS has an easy way to detect who owns the mysql:// protocol, because if I can just detect what App is going to respond to open mysql:// then I can easily detect which app to

  1. Show in the button like #1 above if it's Sequel Pro

Hope that helps how I'm going to approach this. Again, if I have to do anything extra beyond this it might not be worth it to me time-wise. But if it's as easy as ⬆️ then I think it's a worthy effort.

@afragen
Copy link

afragen commented Oct 29, 2021

Here's what I found. I hope it helps.

https://sequelpro.com/docs/url-scheme

Looks like they use a different URL scheme. I don't know if that's easier or harder.

@afragen
Copy link

afragen commented Oct 29, 2021

Perhaps just looking at something like

if TablesPlus is present {}
if Sequel Pro is present {}

@chrismccoy
Copy link

Sequel PRO nightly does work using the socket.

How this addon works is it symlinks /tmp/mysql.sock to the mysql.sock file in Local for the site, it then uses macOS open to open a mysql:// protocol URL to /tmp/mysql.sock which should connect to the Local site.

What needs to happen here is I need to be able to do the same thing but

  1. SequelPro needs to become the default for the mysql:// protocol
  2. When I run the mysql:// command with open Sequel Pro needs to connect to it and load the DB

If it will operate that way it's easy for SequelPro to be the fallback, since it is just the App that responds to the mysql:// call and all I have to do is

  1. Replace the "Open TablePlus" with "Open Sequel Pro"
  2. Allow the button to show if you have Sequel Pro installed

I am wondering if macOS has an easy way to detect who owns the mysql:// protocol, because if I can just detect what App is going to respond to open mysql:// then I can easily detect which app to

  1. Show in the button like #1 above if it's Sequel Pro

Hope that helps how I'm going to approach this. Again, if I have to do anything extra beyond this it might not be worth it to me time-wise. But if it's as easy as ⬆️ then I think it's a worthy effort.

the sql app itself has to support using mysql uri's, as tableplus allows you to give a database uri structure.

I use navicat, which doesnt allow those structures when adding a database connection

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants