Skip to content

nilz3ro/rusty-pet-shop

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gasoline

learing diesel, actix-web, and tying them together with r2d2

build the container:

docker build -f dev.Dockerfile . -t gasoline

run 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 mysql

get 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_URL

TODO: simplify env stuff.

run native

cargo run

run as container

docker run --rm gasoline

connect native mysql client

#password in example is gasoline
mysql -h 127.0.0.1 -P 3306 -uroot -p

inspect

mysql> show databases;
mysql> use gasoline;
mysql> describe pet;

About

toy REST API built with actix-web, diesel and r2d2.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors