Simple Rust code to perform CRUD operations
- Clone the repository
- Create a .env file in the root directory and add the following data to it
DATABASE_URL=postgres://<username>:<password>@<host>/<db_name>
- Install sqlx-cli using cmd
cargo install sqlx-cli
- Create the db using sqlx-cli
sqlx database create
- Run the migrations
sqlx migration run
- Run the cargo file
cargo run