Demonstrates implementation of asynchronous database operations using SQLx with a PostgreSQL database.
-
Async/Await: Uses Rust's asynchronous programming features to handle database operations.
-
SQLx: Leverages SQLx for safe and efficient database access.
-
Environment Management: Uses
dotenv
to manage environment variables. -
DAO Pattern: Arguably tries to implement a DAO trait to abstract the database operations.
- Rust programming environment (cargo, rustc).
- PostgreSQL server running and accessible.
DATABASE_URL
set in your environment or a.env
file.
- Ensure your PostgreSQL database is accessible and the
DATABASE_URL
environment variable is set correctly. - Clone this repository.
To run the project:
cargo run