Rename filter method to wher, as filter is a SQL keyword with a different use case

This commit is contained in:
Timothy Warren 2019-04-24 11:34:09 -04:00
parent 834cd358b6
commit 6c5abec034
2 changed files with 5 additions and 2 deletions

View File

@ -55,4 +55,4 @@ impl DatabaseDriver for PostgresDriver {
fn random(&self) -> String {
String::from(" RANDOM()")
}
}
}

View File

@ -284,6 +284,9 @@ impl QueryBuilder {
///
/// // Other operators can be used with a separating space
/// qb.r#where("key >", 4);
///
/// // If you don't like the r#where syntax, you can use the wher method instead
/// qb.wher("key >", 4);
/// ```
pub fn r#where(&mut self, key: &str, value: impl Any) -> &mut Self {
self._where_string(key, value, "AND")
@ -291,7 +294,7 @@ impl QueryBuilder {
/// Alias method for `where`, as using the `where` method requires
/// using the raw identifier `r#where`.
pub fn filter(&mut self, key: &str, value: impl Any) -> &mut Self {
pub fn wher(&mut self, key: &str, value: impl Any) -> &mut Self {
self.r#where(key, value)
}