Summary
In this chapter, we constructed a development environment where our app could interact with the database using Docker. Once we did this, we explored the listing of containers and images to inspect how our system in general is going. We then created migrations using the diesel crate. After this, we installed the diesel
client and defined the database URL as an environment variable, so that our Rust app and migrations could directly connect with the database container.
We then ran migrations and defined the SQL scripts that would fire when the migration ran, and ran these in turn. Once this was done, we inspected the database container again to see whether the migration had, in fact, been executed. We then defined the data models in Rust, and refactored our API endpoints, so that they could perform get, edit, create, and delete operations on the database in order keep track of the to-do items.
What we have done here is upgrade our database storage system. We are one step...