mirror of
https://github.com/opdavies/build-configs.git
synced 2025-02-02 05:47:32 +00:00
Add run db
to connect to the database
This commit is contained in:
parent
937f8dce88
commit
97836712f2
|
@ -14,3 +14,7 @@ export DRUSH_OPTIONS_URI="https://${COMPOSE_PROJECT_NAME}.docker.localhost"
|
|||
export MYSQL_DATABASE=app
|
||||
export MYSQL_PASSWORD=app
|
||||
export MYSQL_USER=app
|
||||
|
||||
export DB_NAME="$MYSQL_DATABASE"
|
||||
export DB_PASSWORD="$MYSQL_PASSWORD"
|
||||
export DB_USER="$MYSQL_USER"
|
||||
|
|
|
@ -53,6 +53,13 @@ function composer {
|
|||
_exec php composer "${@}"
|
||||
}
|
||||
|
||||
# Connect to the database.
|
||||
function db {
|
||||
[[ -f ".env" ]] && source .env
|
||||
|
||||
docker compose exec database mysql -u"$DB_USER" -p"$DB_PASSWORD" "$DB_NAME"
|
||||
}
|
||||
|
||||
function drush {
|
||||
_exec php drush "${@}"
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue