Created
November 7, 2022 08:21
-
-
Save ingebrixen/6c9188a649d3a5b79780e9c33f79cada to your computer and use it in GitHub Desktop.
MacOS: ddev dbeaver - open DBeaver for your current ddev project
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
#ddev-generated | |
# Support for dbeaver | |
# This command is available if macOS and dbeaver is installed in the normal place | |
## Description: Run dbeaver with current project database | |
## Usage: dbeaver | |
## Example: "ddev dbeaver" | |
## OSTypes: darwin | |
## HostBinaryExists: /Applications/DBeaver.app | |
dbtype=${DDEV_DBIMAGE%:*} | |
driver=mysql | |
if [[ $dbtype == "postgres" ]]; then | |
driver=$dbtype | |
fi | |
query="-con name=ddev-${DDEV_PROJECT}|driver=$driver|database=db|user=root|password=root|host=127.0.0.1|port=${DDEV_HOST_DB_PORT}" | |
set -x | |
open -a /Applications/DBeaver.app/Contents/MacOS/dbeaver --args $query |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Place the file in
~/.ddev/commands/host/
. Useddev dbeaver
in your current ddev project folder to start DBeaver and connect to the Docker database.