Summarize the request
Currently, the database connection is implemented directly in Diesel and the connection is passed around as a State wrapping a Mutex. rocket_db_pools provides a way to maintain database connections in a Rocket-friendly wrapper. This wrapper has full support for Diesel and could be easier to integrate, automatically pulling the database connection URI from Rocket's config and creating the connection in a safe way for us.
- See this Medium article for an example of how this could be done, main thing to note is the
&** syntax.
The primary reason I'm making this issue and not making the changes immediately is because it depends on Diesel 2.1.x, whereas we're currently on Diesel 2.2.x and waiting for 2.3.x to release for features we need. See rwf2/Rocket#2868 for when this may be updated.
Use case
This would relieve some of the management duties over the connection to Rocket, simplifying our implementation. It may unfortunately decrease code readability.
Summarize the request
Currently, the database connection is implemented directly in Diesel and the connection is passed around as a State wrapping a Mutex. rocket_db_pools provides a way to maintain database connections in a Rocket-friendly wrapper. This wrapper has full support for Diesel and could be easier to integrate, automatically pulling the database connection URI from Rocket's config and creating the connection in a safe way for us.
&**syntax.The primary reason I'm making this issue and not making the changes immediately is because it depends on Diesel 2.1.x, whereas we're currently on Diesel 2.2.x and waiting for 2.3.x to release for features we need. See rwf2/Rocket#2868 for when this may be updated.
Use case
This would relieve some of the management duties over the connection to Rocket, simplifying our implementation. It may unfortunately decrease code readability.