@@ -46,6 +46,8 @@ pub enum Compare<'a> {
4646 Any ( Box < Expression < ' a > > ) ,
4747 /// ALL (`left`)
4848 All ( Box < Expression < ' a > > ) ,
49+ /// `left` IS NOT DISTINCT FROM `right`
50+ IsNotDistinctFrom ( Box < Expression < ' a > > , Box < Expression < ' a > > ) ,
4951}
5052
5153#[ derive( Debug , Clone , PartialEq ) ]
@@ -102,6 +104,12 @@ pub trait Comparable<'a> {
102104 where
103105 T : Into < Expression < ' a > > ;
104106
107+ /// Tests if both sides are not the same value (NULLs are equal).
108+ #[ allow( clippy:: wrong_self_convention) ]
109+ fn is_not_distinct_from < T > ( self , comparison : T ) -> Compare < ' a >
110+ where
111+ T : Into < Expression < ' a > > ;
112+
105113 /// Tests if the left side is smaller than the right side.
106114 fn less_than < T > ( self , comparison : T ) -> Compare < ' a >
107115 where
@@ -194,26 +202,6 @@ pub trait Comparable<'a> {
194202 where
195203 T : Into < Expression < ' a > > ;
196204
197- /// Tests if the JSON array starts with a value.
198- fn json_array_begins_with < T > ( self , item : T ) -> Compare < ' a >
199- where
200- T : Into < Expression < ' a > > ;
201-
202- /// Tests if the JSON array does not start with a value.
203- fn json_array_not_begins_with < T > ( self , item : T ) -> Compare < ' a >
204- where
205- T : Into < Expression < ' a > > ;
206-
207- /// Tests if the JSON array ends with a value.
208- fn json_array_ends_into < T > ( self , item : T ) -> Compare < ' a >
209- where
210- T : Into < Expression < ' a > > ;
211-
212- /// Tests if the JSON array does not end with a value.
213- fn json_array_not_ends_into < T > ( self , item : T ) -> Compare < ' a >
214- where
215- T : Into < Expression < ' a > > ;
216-
217205 /// Tests if the JSON value is of a certain type.
218206 fn json_type_equals < T > ( self , json_type : T ) -> Compare < ' a >
219207 where
@@ -260,6 +248,16 @@ where
260248 val. not_equals ( comparison)
261249 }
262250
251+ fn is_not_distinct_from < T > ( self , comparison : T ) -> Compare < ' a >
252+ where
253+ T : Into < Expression < ' a > > ,
254+ {
255+ let col: Column < ' a > = self . into ( ) ;
256+ let val: Expression < ' a > = col. into ( ) ;
257+
258+ val. is_not_distinct_from ( comparison)
259+ }
260+
263261 fn less_than < T > ( self , comparison : T ) -> Compare < ' a >
264262 where
265263 T : Into < Expression < ' a > > ,
@@ -418,46 +416,6 @@ where
418416 val. json_array_not_contains ( item)
419417 }
420418
421- fn json_array_begins_with < T > ( self , item : T ) -> Compare < ' a >
422- where
423- T : Into < Expression < ' a > > ,
424- {
425- let col: Column < ' a > = self . into ( ) ;
426- let val: Expression < ' a > = col. into ( ) ;
427-
428- val. json_array_begins_with ( item)
429- }
430-
431- fn json_array_not_begins_with < T > ( self , item : T ) -> Compare < ' a >
432- where
433- T : Into < Expression < ' a > > ,
434- {
435- let col: Column < ' a > = self . into ( ) ;
436- let val: Expression < ' a > = col. into ( ) ;
437-
438- val. json_array_not_begins_with ( item)
439- }
440-
441- fn json_array_ends_into < T > ( self , item : T ) -> Compare < ' a >
442- where
443- T : Into < Expression < ' a > > ,
444- {
445- let col: Column < ' a > = self . into ( ) ;
446- let val: Expression < ' a > = col. into ( ) ;
447-
448- val. json_array_ends_into ( item)
449- }
450-
451- fn json_array_not_ends_into < T > ( self , item : T ) -> Compare < ' a >
452- where
453- T : Into < Expression < ' a > > ,
454- {
455- let col: Column < ' a > = self . into ( ) ;
456- let val: Expression < ' a > = col. into ( ) ;
457-
458- val. json_array_not_ends_into ( item)
459- }
460-
461419 fn json_type_equals < T > ( self , json_type : T ) -> Compare < ' a >
462420 where
463421 T : Into < JsonType < ' a > > ,
0 commit comments