mirror of
https://github.com/launchbadge/sqlx.git
synced 2025-10-02 15:25:32 +00:00
feat(core): lift Send bound for arguments to Arguments::add
Execute already required Send so this just makes it fail earlier
This commit is contained in:
parent
7beceba832
commit
34859af1d3
@ -15,7 +15,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 + Encode<'q, Self::Database> + Type<Self::Database>;
|
||||
T: 'q + Send + Encode<'q, Self::Database> + Type<Self::Database>;
|
||||
}
|
||||
|
||||
pub trait IntoArguments<'q, DB: HasArguments<'q>>: Sized + Send {
|
||||
|
@ -58,7 +58,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 + Encode<'q, DB> + Type<DB>>(mut self, value: T) -> Self {
|
||||
pub fn bind<T: 'q + Send + Encode<'q, DB> + Type<DB>>(mut self, value: T) -> Self {
|
||||
if let Some(arguments) = &mut self.arguments {
|
||||
arguments.add(value);
|
||||
}
|
||||
|
@ -41,7 +41,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`](crate::query::Query::bind).
|
||||
pub fn bind<T: 'q + Encode<'q, DB> + Type<DB>>(mut self, value: T) -> Self {
|
||||
pub fn bind<T: 'q + Send + Encode<'q, DB> + Type<DB>>(mut self, value: T) -> Self {
|
||||
self.inner = self.inner.bind(value);
|
||||
self
|
||||
}
|
||||
|
@ -37,7 +37,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 + Encode<'q, DB> + Type<DB>>(mut self, value: T) -> Self {
|
||||
pub fn bind<T: 'q + Send + Encode<'q, DB> + Type<DB>>(mut self, value: T) -> Self {
|
||||
self.inner = self.inner.bind(value);
|
||||
self
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user