| 126 | type Output = Self; |
| 127 | |
| 128 | fn not(self) -> Self::Output { |
| 129 | match self { |
| 130 | Expr::Like(Like { |
| 131 | negated, |
| 132 | expr, |
| 133 | pattern, |
| 134 | escape_char, |
| 135 | case_insensitive, |
| 136 | }) => Expr::Like(Like::new( |
| 137 | !negated, |
| 138 | expr, |
| 139 | pattern, |
| 140 | escape_char, |
| 141 | case_insensitive, |
| 142 | )), |
| 143 | Expr::SimilarTo(Like { |
| 144 | negated, |
| 145 | expr, |
| 146 | pattern, |
| 147 | escape_char, |
| 148 | case_insensitive, |
| 149 | }) => Expr::SimilarTo(Like::new( |
| 150 | !negated, |
| 151 | expr, |
| 152 | pattern, |
| 153 | escape_char, |
| 154 | case_insensitive, |
| 155 | )), |
| 156 | Expr::InList(InList { |
| 157 | expr, |
| 158 | list, |
| 159 | negated, |
| 160 | }) => Expr::InList(InList::new(expr, list, !negated)), |
| 161 | Expr::Exists(Exists { subquery, negated }) => { |
| 162 | Expr::Exists(Exists::new(subquery, !negated)) |
| 163 | } |
| 164 | Expr::InSubquery(InSubquery { |
| 165 | expr, |
| 166 | subquery, |
| 167 | negated, |
| 168 | }) => Expr::InSubquery(InSubquery::new(expr, subquery, !negated)), |
| 169 | _ => Expr::Not(Box::new(self)), |
| 170 | } |
| 171 | } |
| 172 | } |
| 173 | |
| 174 | #[cfg(test)] |