Install rust. You need
- Install postgresql and setup an user and a database. After setting up an user, your connection
string will be like
postgresql://admin:admin@localhost
, with username and password to replace. - Put this variable as
DATABASE_URL
in a.env
file at the root of the project:
DATABASE_URL=postgresql://admin:admin@localhost
- Install sqlx cli:
cargo install sqlx-cli
, providing thesqlx
binary. - Run the database migrations:
sqlx migrate run --database-url=postgresql://admin:admin@localhost
- Run the app:
cargo run
Run the app with RUST_LOG
variable set, for example: RUST_LOG="debug" cargo run
.
RUST_LOG
can be set on a more precise level, see the doc for env_logger.