Terminal and DDEV
TablePro opens any database URL passed to it by the operating system. That makes it scriptable from the shell, and it is how the DDEV integration below works.Open a database from the shell
Pass a connection URL toopen:
Force TablePro over another client
open "mysql://..." goes to whichever app owns the mysql:// scheme. If TablePlus or another client is installed, it may win. Target TablePro by its bundle identifier:
Install the tablepro command
Open Settings > General > Command Line and click Install. This writes a smalltablepro script to /usr/local/bin that always opens TablePro:
/usr/local/bin is owned by root on a stock macOS install, and may not exist at all. When TablePro cannot write there itself, macOS asks for your administrator password, and TablePro then creates the folder and the command. Cancel the password prompt and nothing is written.
If that fails too, Settings falls back to showing the exact sudo command to run in Terminal. Run it and switch back to TablePro, and Settings picks up the change on its own.
DDEV
DDEV ships atablepro command. From any project:
/Applications. If ddev tablepro is not found, update DDEV.
This is the right way to open a DDEV database, because DDEV gives the project a new host port on every ddev start. A saved connection goes stale; the command reads the current port each time. It works with both MySQL/MariaDB and PostgreSQL projects. DDEV’s database, user, and password are all db.
Trusting a link
The first time a link connects, TablePro asks you to confirm it. This stops a web page from silently opening a connection. For a database on your own machine (localhost, 127.0.0.1, or ::1), the alert also offers Always Allow. Choose it and TablePro stops asking for that database, so ddev tablepro connects straight away. Trust is keyed on the database type, host, database name, user, and the name parameter, but not the port, because DDEV changes the port on every start.
Only databases on your own machine can be trusted. A link to a remote host always asks, every time.
?query=), a filter (?condition=), or a pre-connect script still asks for confirmation, even when the connection is trusted.