New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implementation of Executor
is not general enough
#3150
Comments
I must admit I'm also struggling with Executor for several hours today. For some reason, attempts to make a function generic over DB: Database lead to repeated suggestions to add deeply nested trait bounds to tell rustc things which are definitely true are indeed true, and even adding the bounds didn't work to satisfy this "execute" function. error[E0277]: the trait bound Likewise with arguments, error[E0599]: the method and with Types, make sure they're both Type and Encode! : error[E0277]: the trait bound I really like the concept of
I guess I figured Database would be "enough" for Pool to execute commands and for number types to know how to go into sql. Seems like I need to add a bound for every Type of thing and specify that yes, you can Encode them for this Database, and make sure the Pool and the PoolConnection Connection are all Executor, and don't forget that the Arguments in HasArguments need to implement IntoArguments ? Ugh. How do we make this simpler, please? Is Database just a marker and I'm using the wrong generic here? I'd love to just hardcode everything for Postgres but I can't because I need to support MySQL. And SQLite is also a |
Bug Description
When try use
execute()
function inraw_sql
, it cause this. Butexecute_many()
is OK.This error only shown in
tokio::spawn()
, if removetokio::spawn()
, error disappear.Minimal Reproduction
Info
v0.8.0-alpha.0
["sqlite", "runtime-tokio"]
3.45.2
Arch linux
rustc --version
:rustc 1.77.0 (aedd173a2 2024-03-17)
The text was updated successfully, but these errors were encountered: