-
Install rustup. You can use the following command for UNIX / Ubuntu / WSL
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
-
Rust nightly as your default toolchain by running the command:
rustup default nightly
-
Enjoy 🚀
Diesel is the best ORM currently in Rust. Check the page for code examples and overviews
- For Ubuntu/Debian Install libmysqlclient-dev package, for windows install mysql-client binaries.
apt install libmysqlclient-dev
- Config
DATABASE_URL
environment variable with your mysql URI database location URI Example - Execute
cargo install diesel_cli --no-default-features --features mysql
- Execute
diesel migration run
for execute migrations to create the project database - Execute
cargo run
at cargo.toml level. - Now you can use the api at http://localhost:8000