In the previous chapter, we learned about interacting with different databases. But the approach we discussed has potential difficulties—you have to check the raw requests you add to your application. It's better if the Rust compiler controls the structure of the data and generates all the necessary requests for the declared structs. This formal and strict approach is possible with the diesel crate.
Rust has an awesome feature that creates macros and generates code. It allowed the creators of the diesel crate to create a domain-specific language to query data from a database. To start using this crate, we need to add it to a new project.