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

Feature Request: Open TablePlus and connect to database from command line #227

Closed
kevinkaske opened this issue Feb 9, 2018 · 6 comments
Closed

Comments

@kevinkaske
Copy link

I use Freeter (https://freeter.io/) to organize my development env. It would be nice to be able to open TablePlus from the command line and pass in the databases I want to connect to. I could then assign that to a button in Freeter for each project.

@huyphams
Copy link
Contributor

huyphams commented Feb 9, 2018

Hmm, have you try to type: open postgresql://user@127.0.0.1/<database_name> ?

TablePlus supports open a connection via command line with an URL.

@kevinkaske
Copy link
Author

Works perfectly! Thank you!

@emadel80
Copy link

emadel80 commented Jan 14, 2019

@huyphams Thank you for the hint. In my case working temporarily with sqlite. Just had to type in the terminal:

open database/database.sqlite

@Graloth
Copy link

Graloth commented Mar 7, 2020

How would you do this on windows? I can't really find a list of flags to pass to the .exe when launching it if that is how it's done, and the "open" command doesn't exist on windows.

@rfay
Copy link

rfay commented Dec 8, 2020

@Graloth I asked your question about launching with connection string on Windows again as a new issue in #2224

@HelgeSverre
Copy link

For future searchers.

If you right click on an existing connection
CleanShot 2023-10-09 at 10 37 28

You will get something like this:

mysql://@127.0.0.1?statusColor=005392&env=local&name=Laravel%20Herd&tLSMode=0&usePrivateKey=false&safeModeLevel=0&advancedSafeModeLevel=0&driverVersion=0

You can truncate it down to only the name of the connection:

mysql://@127.0.0.1?name=Laravel%20Herd

Then throw that into an alias like so:

alias db="open mysql://@127.0.0.1?name=Laravel%20Herd"

Note if you use zsh, you need to quote the url:

alias db="open 'mysql://@127.0.0.1?name=Laravel%20Herd'"

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

No branches or pull requests

6 participants