Replies: 2 comments
-
So you want your function to work for multiple databases? Have you looked into the |
Beta Was this translation helpful? Give feedback.
0 replies
-
Please look at the examples in https://docs.rs/sqlx/latest/sqlx/trait.Acquire.html, which should give you the answer. |
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
-
I spend about an hour today trying to figure out how to pass a Transaction as a argument to another function. My main idea was to pass in a
&mut Transaction<'t, DB>
where DB is a sqlx::Database. I can pass in the TX like that, but when I try to use it within execute() the compiler says that Executor is not implemented for it. I guess that is because Executor is just implemented for some databases and not general for sqlx::Database.However, I'm not that experienced in rust, perhaps my approach is just wrong.
What is the idiomatic way to pass a tx around?
Beta Was this translation helpful? Give feedback.
All reactions