mirror of
https://github.com/launchbadge/sqlx
synced 2024-11-10 06:24:16 +00:00
Add push_bind_unseparated
for Separated
in query builder (#1985)
This commit is contained in:
parent
d7277f41eb
commit
8fc4625ec7
1 changed files with 13 additions and 1 deletions
|
@ -137,7 +137,7 @@ where
|
|||
///
|
||||
/// The returned type exposes identical [`.push()`][Separated::push] and
|
||||
/// [`.push_bind()`][Separated::push_bind] methods which push `separator` to the query
|
||||
/// before their normal behavior. [`.push_unseparated()`][Separated::push_unseparated] is also
|
||||
/// before their normal behavior. [`.push_unseparated()`][Separated::push_unseparated] and [`.push_bind_unseparated()`][Separated::push_bind_unseparated] are also
|
||||
/// provided to push a SQL fragment without the separator.
|
||||
///
|
||||
/// ```rust
|
||||
|
@ -494,6 +494,18 @@ where
|
|||
|
||||
self
|
||||
}
|
||||
|
||||
/// Push a bind argument placeholder (`?` or `$N` for Postgres) and bind a value to it
|
||||
/// without a separator.
|
||||
///
|
||||
/// 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>,
|
||||
{
|
||||
self.query_builder.push_bind(value);
|
||||
self
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
|
|
Loading…
Reference in a new issue