From 6c5abec034cf3b0129e8c056c9fae4c14478f44d Mon Sep 17 00:00:00 2001 From: Timothy Warren Date: Wed, 24 Apr 2019 11:34:09 -0400 Subject: [PATCH] Rename filter method to wher, as filter is a SQL keyword with a different use case --- src/drivers/postgres.rs | 2 +- src/query_builder.rs | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/drivers/postgres.rs b/src/drivers/postgres.rs index 77a3ce3..9144f3c 100644 --- a/src/drivers/postgres.rs +++ b/src/drivers/postgres.rs @@ -55,4 +55,4 @@ impl DatabaseDriver for PostgresDriver { fn random(&self) -> String { String::from(" RANDOM()") } -} +} \ No newline at end of file diff --git a/src/query_builder.rs b/src/query_builder.rs index b535bcd..94ede04 100644 --- a/src/query_builder.rs +++ b/src/query_builder.rs @@ -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) }