Skip to content

Commit

Permalink
Add push_bind_unseparated for Separated in query builder (#1985)
Browse files Browse the repository at this point in the history
  • Loading branch information
0xdeafbeef authored Jul 19, 2022
1 parent d7277f4 commit 8fc4625
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion sqlx-core/src/query_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)]
Expand Down

0 comments on commit 8fc4625

Please sign in to comment.