Docker Postgres Database Server with Rust,
Clean Database
docker-compose down -vCreate an .env
cp .env.example .envInit Database
docker-compose up -dIf you don’t already have
SQLX-CLItool installed, runcargo install sqlx-clito install it.
Migrate Db
sqlx migrate runInit Server
cargo runOr Watch server
cargo watch -q -c -w src/ -x runOpen Swagger UI
open http://0.0.0.0:8000/api-v1To run tests, make sure the database is running and it is clean.
docker-compose down -vCreate an .env
cp .env.example .envInit Database
docker-compose up -dMigrate Db
sqlx migrate runExecute tests
cargo test