List Resource
Explore how to create Rust models for products and variants, serialize and test database queries, and return listings with related data using Diesel. Understand setting up models, connecting to test databases, and implementing functions that fetch product details and their variants.
We'll cover the following...
We'll cover the following...
List products
We add the models.rs file for our models in the src folder with the products model.
Note: Find more information about the file structure in the Set Up Diesel lesson.
The first model, Product, will be used to get data from the database.
It needs to be serialized, so ...