Giter VIP home page Giter VIP logo

wpcodevo / rust-axum-mysql Goto Github PK

View Code? Open in Web Editor NEW
25.0 1.0 5.0 28 KB

In this article, you'll discover how to use the Axum framework to build a RESTful API in Rust that supports basic CRUD (Create, Read, Update, Delete) operations against a MySQL database.

Home Page: https://codevoweb.com/rust-crud-api-example-with-axum-framework-and-mysql/

Makefile 4.32% Rust 95.68%
axum axum-framework crud crud-api docker mysql-database rust sqlx sqlx-cli

rust-axum-mysql's Introduction

Rust CRUD API Example with Axum Framework and MySQL

In this article, you'll discover how to use the Axum framework to build a RESTful API in Rust that supports basic CRUD (Create, Read, Update, Delete) operations against a MySQL database. To achieve this, we'll be leveraging the SQLx toolkit, which provides a simple and efficient way to interact with databases.

Rust CRUD API Example with Axum Framework and MySQL

Topics Covered

  • Set up and Run the Axum MySQL CRUD API Project
  • Run the Axum CRUD API with a Frontend App
  • Set up the Rust Project
  • Set up the MySQL Server with Docker
  • Connect the Axum Server to the MySQL Server
  • Perform Database Migrations
  • Define the SQLX Database Model
  • Define the API Request Structs
  • Implement the CRUD Functionalities
    • Route Function to Fetch All Records
    • Route Function to Insert a Record
    • Route Function to Retrieve a Record
    • Route Function to Edit a Record
    • Route Function to Delete a Record
    • The Complete Code of the Route Functions
  • Create an Axum Router for the Route Functions
  • Register the Axum Router and Set up CORS
  • Conclusion

Read the entire article here: https://codevoweb.com/rust-crud-api-example-with-axum-framework-and-mysql/

rust-axum-mysql's People

Contributors

wpcodevo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.