-
I'd like to integrate Diesel into a web app powered by xitca_web. Different API endpoints will need to use the DB, so I've put that in a shared state that can be accessed by the handle functions. tldr: I've got an The problem I'm facing is that I think having a shared DB connection is a good idea, since recreating a connection object with every request would be very inefficient. Am I doing something wrong? Is there a way to solve this problem? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
You shold be using some connection pool that will keep those connections open for you. |
Beta Was this translation helpful? Give feedback.
You shold be using some connection pool that will keep those connections open for you.
https://docs.diesel.rs/2.2.x/diesel/r2d2/index.html