Skip to content
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

Removed Send trait bound from argument binding #2960

Merged
merged 1 commit into from
Mar 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion sqlx-core/src/any/arguments.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ impl<'q> Arguments<'q> for AnyArguments<'q> {

fn add<T>(&mut self, value: T)
where
T: 'q + Send + Encode<'q, Self::Database> + Type<Self::Database>,
T: 'q + Encode<'q, Self::Database> + Type<Self::Database>,
{
let _ = value.encode(&mut self.values);
}
Expand Down
2 changes: 1 addition & 1 deletion sqlx-core/src/arguments.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ pub trait Arguments<'q>: Send + Sized + Default {
/// Add the value to the end of the arguments.
fn add<T>(&mut self, value: T)
where
T: 'q + Send + Encode<'q, Self::Database> + Type<Self::Database>;
T: 'q + Encode<'q, Self::Database> + Type<Self::Database>;

fn format_placeholder<W: Write>(&self, writer: &mut W) -> fmt::Result {
writer.write_str("?")
Expand Down
2 changes: 1 addition & 1 deletion sqlx-core/src/query.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ impl<'q, DB: Database> Query<'q, DB, <DB as HasArguments<'q>>::Arguments> {
///
/// There is no validation that the value is of the type expected by the query. Most SQL
/// flavors will perform type coercion (Postgres will return a database error).
pub fn bind<T: 'q + Send + Encode<'q, DB> + Type<DB>>(mut self, value: T) -> Self {
pub fn bind<T: 'q + Encode<'q, DB> + Type<DB>>(mut self, value: T) -> Self {
if let Some(arguments) = &mut self.arguments {
arguments.add(value);
}
Expand Down
2 changes: 1 addition & 1 deletion sqlx-core/src/query_as.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ impl<'q, DB: Database, O> QueryAs<'q, DB, O, <DB as HasArguments<'q>>::Arguments
/// Bind a value for use with this SQL query.
///
/// See [`Query::bind`](Query::bind).
pub fn bind<T: 'q + Send + Encode<'q, DB> + Type<DB>>(mut self, value: T) -> Self {
pub fn bind<T: 'q + Encode<'q, DB> + Type<DB>>(mut self, value: T) -> Self {
self.inner = self.inner.bind(value);
self
}
Expand Down
6 changes: 3 additions & 3 deletions sqlx-core/src/query_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ where
/// [postgres-limit-issue]: https://github.com/launchbadge/sqlx/issues/671#issuecomment-687043510
pub fn push_bind<T>(&mut self, value: T) -> &mut Self
where
T: 'args + Encode<'args, DB> + Send + Type<DB>,
T: 'args + Encode<'args, DB> + Type<DB>,
{
self.sanity_check();

Expand Down Expand Up @@ -569,7 +569,7 @@ where
/// See [`QueryBuilder::push_bind()`] for details.
pub fn push_bind<T>(&mut self, value: T) -> &mut Self
where
T: 'args + Encode<'args, DB> + Send + Type<DB>,
T: 'args + Encode<'args, DB> + Type<DB>,
{
if self.push_separator {
self.query_builder.push(&self.separator);
Expand All @@ -587,7 +587,7 @@ where
/// Simply calls [`QueryBuilder::push_bind()`] directly.
pub fn push_bind_unseparated<T>(&mut self, value: T) -> &mut Self
where
T: 'args + Encode<'args, DB> + Send + Type<DB>,
T: 'args + Encode<'args, DB> + Type<DB>,
{
self.query_builder.push_bind(value);
self
Expand Down
2 changes: 1 addition & 1 deletion sqlx-core/src/query_scalar.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ impl<'q, DB: Database, O> QueryScalar<'q, DB, O, <DB as HasArguments<'q>>::Argum
/// Bind a value for use with this SQL query.
///
/// See [`Query::bind`](crate::query::Query::bind).
pub fn bind<T: 'q + Send + Encode<'q, DB> + Type<DB>>(mut self, value: T) -> Self {
pub fn bind<T: 'q + Encode<'q, DB> + Type<DB>>(mut self, value: T) -> Self {
self.inner = self.inner.bind(value);
self
}
Expand Down
Loading