learing diesel, actix-web, and tying them together with r2d2
build the container:
docker build -f dev.Dockerfile . -t gasolinerun it
make sure you have mysql running or run it with docker
docker run --name some_mysql -p 3306:3306 -e MYSQL_ROOT_PASSWORD=gasoline mysqlget dburl from example env file.
# build db url
source .env
echo $DATABASE_URL
#setup
diesel setup --database-url $DATABASE_URL
#migrations
diesel migration run --database-url $DATABASE_URLTODO: simplify env stuff.
run native
cargo run
run as container
docker run --rm gasolineconnect native mysql client
#password in example is gasoline
mysql -h 127.0.0.1 -P 3306 -uroot -pinspect
mysql> show databases;
mysql> use gasoline;
mysql> describe pet;