In this chapter, we'll discuss on why databases are essential to modern applications. We'll cover a few crates that are available in the Rust ecosystem, which allows one to interact with databases. We'll then continue with our linksnap API server that we developed in the previous chapter and integrate database support into it through a convenient library. This will allow us to persist new bookmarks that are sent to our API.
In this chapter, we will cover the following topics:
- SQLite integration using rusqlite
- Interacting with PostgreSQL with Rust
- Database connection pooling
- Object-relational mapping using the diesel crate
- Integrating diesel with the linksnap API server