From 69616a4ff67749a24802787dcec94d9361c03aa0 Mon Sep 17 00:00:00 2001 From: Einliterflasche Date: Sun, 21 May 2023 16:53:30 +0200 Subject: [PATCH] Improve docs --- pg-worm/src/lib.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/pg-worm/src/lib.rs b/pg-worm/src/lib.rs index 0757969..14f64e7 100644 --- a/pg-worm/src/lib.rs +++ b/pg-worm/src/lib.rs @@ -421,14 +421,23 @@ impl Column { } } + /// Check whether the columns value is equal to `value`. + /// + /// Translates to `WHERE = `. pub fn eq(&self, value: impl Into) -> Filter { Filter::new(format!("{} = $1", self.name), vec![Box::new(value.into())]) } + /// Check whether the columns value is not equalt to `value` + /// + /// Tranlates to `WHERE != `. pub fn neq(&self, value: impl Into) -> Filter { Filter::new(format!("{} != $1", self.name), vec![Box::new(value.into())]) } + /// Check whether the columns value is one of `values`. + /// + /// Translates to `WHERE IN ` pub fn one_of(&self, values: Vec>) -> Filter { // Early return if no values are supplied if values.is_empty() { @@ -451,6 +460,9 @@ impl Column { Filter::new(format!("{} IN ({placeholders})", self.name), vals) } + /// Check whether the columns value is not one of `values`. + /// + /// Translates to `WHERE NOT IN ` pub fn none_of(&self, values: Vec>) -> Filter { // Early return if no values are supplied if values.is_empty() {