Auto-create MySQL connect string in env vars

This commit is contained in:
Keith Edmunds 2022-02-06 17:38:40 +00:00
parent 2015dcce1f
commit 3cab7a8376

10
.envrc
View File

@ -1 +1,11 @@
layout poetry
MYSQL_USER="musicmuster"
MYSQL_PASSWORD="musicmuster"
branch=$(git branch --show-current)
if on_git_branch master; then
MYSQL_DATABASE="musicmuster_prod"
elif on_git_branch v2; then
MYSQL_DATABASE="musicmuster_v2"
else MYSQL_DATABASE="musicmuster_dev"
fi
export MYSQL_CONNECT="mysql+mysqldb://${MYSQL_USER}:${MYSQL_PASSWORD}@localhost/${MYSQL_DATABASE}"