-
SummaryWe have several examples of passing connections/pools via state (I love this feature!). However, there doesn't seem to be an example of a handler that takes both a connection from state AND a JSON payload. Initial attempts to do this seem to make our functions no longer qualified as handlers. I wonder if there's a nice way of doing this without having to write implementations for every combination of payload and connection. If someone can guide me I would be happy to update the examples for this. I'm specifically looking at the sqlx example axum/examples/sqlx-postgres/src/main.rs Line 65 in dd8d4a4 axum version0.8.4 |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 5 replies
-
What did you try and how did it fail? |
Beta Was this translation helpful? Give feedback.
Ahh something that was not clear to me (maybe should have been): with_state needs to specifically be on the routes/nests that take that state. I had falsely assumed that just applied to the entire app/router and the error message wasn't super clear as a new-comer.