Share a state #69
Unanswered
josejachuf
asked this question in
Q&A
Replies: 2 comments
-
You can use some code like this:
Just call db_pool when you want pool. You can reference this if you use diesel: |
Beta Was this translation helpful? Give feedback.
0 replies
-
I will see this. Thanks @fergus-hou |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi, I'm starting to learn Rust, particularly watching some web frameworks. I liked Tide, but yesterday I knew Salvo and wanted to migrate some things in which I was working to Salvo.
In Tide I can share a state enter all the requests, a pool of connections for example
let mut app = tide::with_state(state);
How do I inject my pool of connections with Salvo?
Use a Middleware? If so, how do I do it?
I use sqlx
Thanks
Jose
Beta Was this translation helpful? Give feedback.
All reactions