sqlx icon indicating copy to clipboard operation
sqlx copied to clipboard

Removed `Send` trait bound from argument binding

Open bobozaur opened this issue 1 year ago • 2 comments

Initial PR that removes all the Send trait bounds from various argument binding methods. While the argument buffer makes sense to be Send as it might be passed around, arguments passed in are immediately encoded away, so it does not seem to be required for them to be Send.

The PR could be expanded to add an Encode impl for std::fmt::Arguments (the initial motivation for removing the bounds) and even make the Text adapter rely on it when getting encoded.

Fixes #2959

bobozaur avatar Jan 02 '24 14:01 bobozaur

If you rebase, it should hopefully fix the error.

I don't disagree with removing the Send bound but it is a breaking change to the Arguments trait.

abonander avatar Jan 06 '24 03:01 abonander

If you rebase, it should hopefully fix the error.

I don't disagree with removing the Send bound but it is a breaking change to the Arguments trait.

What do you think about adding an Encode impl for the std::fmt::Arguments type?

bobozaur avatar Jan 06 '24 07:01 bobozaur

You can just wrap fmt::Arguments in Text()

abonander avatar Mar 14 '24 19:03 abonander