-
-
Save daciomedina/f652a747054ca1dabb9b3b264313442d to your computer and use it in GitHub Desktop.
Script to add ddev command for open Dbeaver in current project - Ubuntu WSL2
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 | |
## Description: Run DBeaver against current db | |
## Usage: db | |
## Example: "ddev db" | |
## OSTypes: windows,wsl2 | |
## HostBinaryExists: /mnt/c/Program Files/DBeaver/dbeaver.exe,C:\Program Files\DBeaver/dbeaver.exe | |
arguments="-nl es -nosplash -con \"connect=true|driver=mysql|user=root|password=root|host=127.0.0.1|port=${DDEV_HOST_DB_PORT}|name=${DDEV_SITENAME}\"" | |
case $OSTYPE in | |
"win*"* | "msys"*) | |
'/c/Program Files/DBeaver/dbeaver.exe' "$arguments" & | |
;; | |
# linux-gnu in this case is only WSL2 as selected in OSTypes above | |
"linux-gnu") | |
# DBeaver is Microsoft only, but we want to start it from WSL2 | |
'/mnt/c/Program Files/DBeaver/dbeaver-cli.exe' $arguments & | |
;; | |
esac |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment