Browse Source

Add NotEqual comparison.

Kestrel 2 years ago
parent
commit
75e022982f
2 changed files with 4 additions and 0 deletions
  1. 2 0
      microrm/src/query/build.rs
  2. 2 0
      microrm/src/query/resolve.rs

+ 2 - 0
microrm/src/query/build.rs

@@ -89,6 +89,7 @@ pub enum CompareOp {
     Equals,
     AtLeast,
     MoreThan,
+    NotEqual
 }
 
 impl CompareOp {
@@ -99,6 +100,7 @@ impl CompareOp {
             Self::Equals => "=",
             Self::AtLeast => ">=",
             Self::MoreThan => ">",
+            Self::NotEqual => "!=",
         }
     }
 }

+ 2 - 0
microrm/src/query/resolve.rs

@@ -44,6 +44,7 @@ where
             },
         )
     }
+
     fn result(self) -> Result<Option<WithID<T>>, crate::Error>
     where
         Self: Sized,
@@ -66,6 +67,7 @@ where
             },
         )
     }
+
     fn results(self) -> Result<Vec<WithID<T>>, crate::Error>
     where
         Self: Sized,