An open API service indexing awesome lists of open source software.

https://github.com/wpcodevo/rust-axum-postgres-api

Are you interested in building a Rust API with CRUD functionalities using the Axum framework and PostgreSQL database? If so, you're in the right place! In this article, I will guide you through building a functional note-taking application API using Rust, Axum, SQLX, and PostgreSQL.
https://github.com/wpcodevo/rust-axum-postgres-api

axum axum-framework postgres postgresql rust sqlx

Last synced: 16 days ago
JSON representation

Are you interested in building a Rust API with CRUD functionalities using the Axum framework and PostgreSQL database? If so, you're in the right place! In this article, I will guide you through building a functional note-taking application API using Rust, Axum, SQLX, and PostgreSQL.

Awesome Lists containing this project

README

        

# Rust CRUD API Example with Axum and PostgreSQL

Are you interested in building a Rust API with CRUD functionalities using the Axum framework and PostgreSQL database? If so, you're in the right place! In this article, I will guide you through building a functional note-taking application API using Rust, Axum, SQLX, and PostgreSQL.

![Rust CRUD API Example with Axum and PostgreSQL](https://codevoweb.com/wp-content/uploads/2023/04/Rust-CRUD-API-Example-with-Axum-and-PostgreSQL.webp)

## Topics Covered

- Run the Axum PostgreSQL API Locally
- Run the Axum API with a Frontend Application
- Setup the Axum and Rust Project
- Setup Postgres and pgAdmin Servers with Docker
- Run Database Migrations with SQLx-CLI
- Connect to the Postgres Server with SQLx
- Create the SQLX Database Model
- Create the Request Validation Structs
- Implement the CRUD Functionalities
- Axum Route Handler to Fetch All Records
- Axum Route Handler to Add a Record
- Axum Route Handler to Fetch a Record
- Axum Route Handler to Edit a Record
- Axum Route Handler to Delete a Record
- The Complete Axum Route Handlers
- Create the CRUD API Endpoints
- Register the Axum Router and Setup CORS
- Conclusion

Read the entire article here: [https://codevoweb.com/rust-crud-api-example-with-axum-and-postgresql/](https://codevoweb.com/rust-crud-api-example-with-axum-and-postgresql/)