Add push_bind_unseparated for Separated in query builder (#1985)

This commit is contained in:
Vladimir 2022-07-19 09:10:33 +02:00 committed by GitHub
parent d7277f41eb
commit 8fc4625ec7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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)]