Rename filter method to wher, as filter is a SQL keyword with a different use case
This commit is contained in:
parent
834cd358b6
commit
6c5abec034
@ -55,4 +55,4 @@ impl DatabaseDriver for PostgresDriver {
|
|||||||
fn random(&self) -> String {
|
fn random(&self) -> String {
|
||||||
String::from(" RANDOM()")
|
String::from(" RANDOM()")
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -284,6 +284,9 @@ impl QueryBuilder {
|
|||||||
///
|
///
|
||||||
/// // Other operators can be used with a separating space
|
/// // Other operators can be used with a separating space
|
||||||
/// qb.r#where("key >", 4);
|
/// 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 {
|
pub fn r#where(&mut self, key: &str, value: impl Any) -> &mut Self {
|
||||||
self._where_string(key, value, "AND")
|
self._where_string(key, value, "AND")
|
||||||
@ -291,7 +294,7 @@ impl QueryBuilder {
|
|||||||
|
|
||||||
/// Alias method for `where`, as using the `where` method requires
|
/// Alias method for `where`, as using the `where` method requires
|
||||||
/// using the raw identifier `r#where`.
|
/// 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)
|
self.r#where(key, value)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user