1use crate::dsl::{AsExpr, AsExprOf, SqlTypeOf};
2use crate::expression::Expression;
3use crate::expression::grouped::Grouped;
4use crate::expression_methods::JsonIndex;
5use crate::pg::expression::expression_methods::private::JsonRemoveIndex;
6use crate::pg::types::sql_types::Array;
7use crate::sql_types::Nullable;
8use crate::sql_types::{Inet, Integer, VarChar};
9
10#[cfg(feature = "postgres_backend")]
12pub type ILike<Lhs, Rhs> = Grouped<super::operators::ILike<Lhs, AsExprOf<Rhs, VarChar>>>;
13#[doc(hidden)] pub type Ilike<Lhs, Rhs> = ILike<Lhs, Rhs>;
15
16#[cfg(feature = "postgres_backend")]
18pub type NotILike<Lhs, Rhs> = Grouped<super::operators::NotILike<Lhs, AsExprOf<Rhs, VarChar>>>;
19#[doc(hidden)] pub type NotIlike<Lhs, Rhs> = NotILike<Lhs, Rhs>;
21
22#[cfg(feature = "postgres_backend")]
24pub type SimilarTo<Lhs, Rhs> = Grouped<super::operators::SimilarTo<Lhs, AsExprOf<Rhs, VarChar>>>;
25
26#[cfg(feature = "postgres_backend")]
28pub type NotSimilarTo<Lhs, Rhs> =
29 Grouped<super::operators::NotSimilarTo<Lhs, AsExprOf<Rhs, VarChar>>>;
30
31#[cfg(feature = "postgres_backend")]
33pub type IsNotDistinctFrom<Lhs, Rhs> =
34 Grouped<super::operators::IsNotDistinctFrom<Lhs, AsExpr<Rhs, Lhs>>>;
35
36#[cfg(feature = "postgres_backend")]
38pub type IsDistinctFrom<Lhs, Rhs> =
39 Grouped<super::operators::IsDistinctFrom<Lhs, AsExpr<Rhs, Lhs>>>;
40
41#[cfg(feature = "postgres_backend")]
44pub type OverlapsWith<Lhs, Rhs> = Grouped<super::operators::OverlapsWith<Lhs, AsExpr<Rhs, Lhs>>>;
45
46#[cfg(feature = "postgres_backend")]
49pub type Contains<Lhs, Rhs> = Grouped<super::operators::Contains<Lhs, AsExpr<Rhs, Lhs>>>;
50
51#[doc(hidden)]
52#[deprecated(note = "Use `Contains` instead")]
53pub type ArrayContains<Lhs, Rhs> = Contains<Lhs, Rhs>;
54
55#[cfg(feature = "postgres_backend")]
58pub type RangeContains<Lhs, Rhs> = Grouped<
59 super::operators::Contains<
60 Lhs,
61 AsExprOf<Rhs, <SqlTypeOf<Lhs> as super::expression_methods::RangeOrMultirange>::Inner>,
62 >,
63>;
64
65#[cfg(feature = "postgres_backend")]
68pub type RangeExtendsRightTo<Lhs, Rhs> =
69 Grouped<super::operators::ExtendsRightTo<Lhs, AsExpr<Rhs, Lhs>>>;
70
71#[cfg(feature = "postgres_backend")]
74pub type RangeExtendsLeftTo<Lhs, Rhs> =
75 Grouped<super::operators::ExtendsLeftTo<Lhs, AsExpr<Rhs, Lhs>>>;
76
77#[cfg(feature = "postgres_backend")]
80pub type ContainsRange<Lhs, Rhs> = Contains<Lhs, Rhs>;
81
82#[cfg(feature = "postgres_backend")]
85pub type IsContainedBy<Lhs, Rhs> = Grouped<super::operators::IsContainedBy<Lhs, AsExpr<Rhs, Lhs>>>;
86
87#[cfg(feature = "postgres_backend")]
89pub type IsContainedByRange<Lhs, Rhs> = Grouped<
90 super::operators::IsContainedBy<Lhs, AsExprOf<Rhs, diesel::sql_types::Range<SqlTypeOf<Lhs>>>>,
91>;
92
93#[cfg(feature = "postgres_backend")]
95pub type LesserThanRange<Lhs, Rhs> =
96 Grouped<super::operators::IsContainedByNet<Lhs, AsExpr<Rhs, Lhs>>>;
97
98#[doc(hidden)] pub type LesserThan<Lhs, Rhs> = LesserThanRange<Lhs, Rhs>;
100
101#[cfg(feature = "postgres_backend")]
103pub type GreaterThanRange<Lhs, Rhs> = Grouped<super::operators::ContainsNet<Lhs, AsExpr<Rhs, Lhs>>>;
104
105#[doc(hidden)] pub type GreaterThan<Lhs, Rhs> = GreaterThanRange<Lhs, Rhs>;
107
108#[cfg(feature = "postgres_backend")]
110pub type UnionRange<Lhs, Rhs> = Grouped<super::operators::UnionsRange<Lhs, AsExpr<Rhs, Lhs>>>;
111
112#[cfg(feature = "postgres_backend")]
114pub type Difference<Lhs, Rhs> = Grouped<super::operators::DifferenceRange<Lhs, AsExpr<Rhs, Lhs>>>;
115
116#[doc(hidden)] pub type DifferenceRange<Lhs, Rhs> = Difference<Lhs, Rhs>;
118
119#[cfg(feature = "postgres_backend")]
121pub type RangeAdjacent<Lhs, Rhs> = Grouped<super::operators::RangeAdjacent<Lhs, AsExpr<Rhs, Lhs>>>;
122
123#[cfg(feature = "postgres_backend")]
125pub type Intersection<Lhs, Rhs> =
126 Grouped<super::operators::IntersectionRange<Lhs, AsExpr<Rhs, Lhs>>>;
127
128#[doc(hidden)] pub type IntersectionRange<Lhs, Rhs> = Intersection<Lhs, Rhs>;
130
131#[cfg(feature = "postgres_backend")]
133pub type NullsFirst<T> = super::operators::NullsFirst<T>;
134
135#[cfg(feature = "postgres_backend")]
137pub type IsJson<T> = super::operators::IsJson<T>;
138
139#[cfg(feature = "postgres_backend")]
141pub type IsNotJson<T> = super::operators::IsNotJson<T>;
142
143#[cfg(feature = "postgres_backend")]
145pub type IsJsonObject<T> = super::operators::IsJsonObject<T>;
146
147#[cfg(feature = "postgres_backend")]
149pub type IsNotJsonObject<T> = super::operators::IsNotJsonObject<T>;
150
151#[cfg(feature = "postgres_backend")]
153pub type IsJsonArray<T> = super::operators::IsJsonArray<T>;
154
155#[cfg(feature = "postgres_backend")]
157pub type IsNotJsonArray<T> = super::operators::IsNotJsonArray<T>;
158
159#[cfg(feature = "postgres_backend")]
161pub type IsJsonScalar<T> = super::operators::IsJsonScalar<T>;
162
163#[cfg(feature = "postgres_backend")]
165pub type IsNotJsonScalar<T> = super::operators::IsNotJsonScalar<T>;
166
167#[cfg(feature = "postgres_backend")]
169pub type NullsLast<T> = super::operators::NullsLast<T>;
170
171#[cfg(feature = "postgres_backend")]
173pub type AtTimeZone<Lhs, Rhs> =
174 Grouped<super::date_and_time::AtTimeZone<Lhs, AsExprOf<Rhs, VarChar>>>;
175
176#[cfg(feature = "postgres_backend")]
179pub type ContainsNet<Lhs, Rhs> = Grouped<super::operators::ContainsNet<Lhs, AsExprOf<Rhs, Inet>>>;
180
181#[cfg(feature = "postgres_backend")]
183pub type ContainsNetLoose<Lhs, Rhs> =
184 Grouped<super::operators::ContainsNetLoose<Lhs, AsExprOf<Rhs, Inet>>>;
185
186#[doc(hidden)] pub type ContainsOrEq<Lhs, Rhs> = ContainsNetLoose<Lhs, Rhs>;
188
189#[cfg(feature = "postgres_backend")]
192pub type IsContainedByNet<Lhs, Rhs> =
193 Grouped<super::operators::IsContainedByNet<Lhs, AsExprOf<Rhs, Inet>>>;
194
195#[cfg(feature = "postgres_backend")]
197pub type IsContainedByNetLoose<Lhs, Rhs> =
198 Grouped<super::operators::IsContainedByNetLoose<Lhs, AsExprOf<Rhs, Inet>>>;
199
200#[doc(hidden)] pub type IsContainedByOrEq<Lhs, Rhs> = IsContainedByNetLoose<Lhs, Rhs>;
202
203#[cfg(feature = "postgres_backend")]
206pub type OverlapsWithNet<Lhs, Rhs> =
207 Grouped<super::operators::OverlapsWith<Lhs, AsExprOf<Rhs, Inet>>>;
208
209#[cfg(feature = "postgres_backend")]
211pub type AndNet<Lhs, Rhs> = Grouped<super::operators::AndNet<Lhs, AsExprOf<Rhs, Inet>>>;
212
213#[cfg(feature = "postgres_backend")]
215pub type OrNet<Lhs, Rhs> = Grouped<super::operators::OrNet<Lhs, AsExprOf<Rhs, Inet>>>;
216
217#[cfg(feature = "postgres_backend")]
219pub type DifferenceNet<Lhs, Rhs> =
220 Grouped<super::operators::DifferenceNet<Lhs, AsExprOf<Rhs, Inet>>>;
221
222#[doc(hidden)] pub type Diff<Lhs, Rhs> = DifferenceNet<Lhs, Rhs>;
224
225#[doc(hidden)]
226#[deprecated(note = "Use `dsl::Concat` instead")]
227pub type ConcatJsonb<Lhs, Rhs> = crate::dsl::Concat<Lhs, Rhs>;
228
229#[cfg(feature = "postgres_backend")]
231pub type HasKeyJsonb<Lhs, Rhs> =
232 Grouped<super::operators::HasKeyJsonb<Lhs, AsExprOf<Rhs, VarChar>>>;
233
234#[doc(hidden)] pub type HasKey<Lhs, Rhs> = HasKeyJsonb<Lhs, Rhs>;
236
237#[cfg(feature = "postgres_backend")]
239pub type HasAnyKeyJsonb<Lhs, Rhs> =
240 Grouped<super::operators::HasAnyKeyJsonb<Lhs, AsExprOf<Rhs, Array<VarChar>>>>;
241
242#[doc(hidden)] pub type HasAnyKey<Lhs, Rhs> = HasAnyKeyJsonb<Lhs, Rhs>;
244
245#[cfg(feature = "postgres_backend")]
247pub type HasAllKeysJsonb<Lhs, Rhs> =
248 Grouped<super::operators::HasAllKeysJsonb<Lhs, AsExprOf<Rhs, Array<VarChar>>>>;
249
250#[doc(hidden)] pub type HasAllKeys<Lhs, Rhs> = HasAllKeysJsonb<Lhs, Rhs>;
252
253#[doc(hidden)]
254#[deprecated(note = "Use `dsl::Contains` instead")]
255pub type ContainsJsonb<Lhs, Rhs> = Contains<Lhs, Rhs>;
256
257#[doc(hidden)]
258#[deprecated(note = "Use `dsl::IsContainedBy` instead")]
259pub type IsContainedByJsonb<Lhs, Rhs> = IsContainedBy<Lhs, Rhs>;
260
261#[cfg(feature = "postgres_backend")]
263pub type Index<Lhs, Rhs> = super::operators::ArrayIndex<Lhs, AsExprOf<Rhs, Integer>>;
264
265#[cfg(feature = "postgres_backend")]
267pub type IndexNullable<Lhs, Rhs> =
268 super::operators::ArrayIndex<Lhs, AsExprOf<Rhs, Nullable<Integer>>>;
269
270#[cfg(feature = "postgres_backend")]
272pub type Slice<Lhs, Rhs1, Rhs2> =
273 super::operators::ArraySlice<Lhs, AsExprOf<Rhs1, Integer>, AsExprOf<Rhs2, Integer>>;
274
275#[cfg(feature = "postgres_backend")]
277pub type SliceNullable<Lhs, Rhs1, Rhs2> = super::operators::ArraySlice<
278 Lhs,
279 AsExprOf<Rhs1, Nullable<Integer>>,
280 AsExprOf<Rhs2, Nullable<Integer>>,
281>;
282
283#[cfg(feature = "postgres_backend")]
285pub type SliceFrom<Lhs, Rhs> = super::operators::ArraySliceFrom<Lhs, AsExprOf<Rhs, Integer>>;
286
287#[cfg(feature = "postgres_backend")]
289pub type SliceFromNullable<Lhs, Rhs> =
290 super::operators::ArraySliceFrom<Lhs, AsExprOf<Rhs, Nullable<Integer>>>;
291
292#[cfg(feature = "postgres_backend")]
294pub type SliceTo<Lhs, Rhs> = super::operators::ArraySliceTo<Lhs, AsExprOf<Rhs, Integer>>;
295
296#[cfg(feature = "postgres_backend")]
298pub type SliceToNullable<Lhs, Rhs> =
299 super::operators::ArraySliceTo<Lhs, AsExprOf<Rhs, Nullable<Integer>>>;
300
301#[doc(hidden)]
302#[deprecated(note = "Use `Index` instead")]
303pub type ArrayIndex<Lhs, Rhs> = Index<Lhs, Rhs>;
304
305#[cfg(feature = "postgres_backend")]
307pub type RemoveFromJsonb<Lhs, Rhs, ST> =
308 Grouped<super::operators::RemoveFromJsonb<Lhs, AsExprOf<Rhs, ST>>>;
309
310#[doc(hidden)] pub type Remove<Lhs, Rhs> = RemoveFromJsonb<
312 Lhs,
313 <Rhs as JsonRemoveIndex>::Expression,
314 <<Rhs as JsonRemoveIndex>::Expression as Expression>::SqlType,
315>;
316
317#[doc(hidden)] pub type RetrieveAsObjectJson<Lhs, Rhs, ST> =
319 Grouped<crate::pg::expression::operators::RetrieveAsObjectJson<Lhs, AsExprOf<Rhs, ST>>>;
320
321#[cfg(feature = "postgres_backend")]
323pub type RetrieveAsObject<Lhs, Rhs> = Grouped<
324 crate::pg::expression::operators::RetrieveAsObjectJson<
325 Lhs,
326 AsExprOf<
327 <Rhs as JsonIndex>::Expression,
328 <<Rhs as JsonIndex>::Expression as Expression>::SqlType,
329 >,
330 >,
331>;
332
333#[doc(hidden)] pub type RetrieveAsTextJson<Lhs, Rhs, ST> =
335 Grouped<crate::expression::operators::RetrieveAsTextJson<Lhs, AsExprOf<Rhs, ST>>>;
336
337#[cfg(feature = "postgres_backend")]
339pub type RetrieveByPathAsObjectJson<Lhs, Rhs> =
340 Grouped<super::operators::RetrieveByPathAsObjectJson<Lhs, AsExprOf<Rhs, Array<VarChar>>>>;
341
342#[doc(hidden)] pub type RetrieveByPathAsObject<Lhs, Rhs> = RetrieveByPathAsObjectJson<Lhs, Rhs>;
344
345#[cfg(feature = "postgres_backend")]
347pub type RetrieveByPathAsTextJson<Lhs, Rhs> =
348 Grouped<super::operators::RetrieveByPathAsTextJson<Lhs, AsExprOf<Rhs, Array<VarChar>>>>;
349
350#[doc(hidden)] pub type RetrieveByPathAsText<Lhs, Rhs> = RetrieveByPathAsTextJson<Lhs, Rhs>;
352
353#[cfg(feature = "postgres_backend")]
355pub type RemoveByPathFromJsonb<Lhs, Rhs> =
356 Grouped<super::operators::RemoveByPathFromJsonb<Lhs, AsExprOf<Rhs, Array<VarChar>>>>;
357
358#[doc(hidden)] pub type RemoveByPath<Lhs, Rhs> = RemoveByPathFromJsonb<Lhs, Rhs>;
360
361#[doc(hidden)]
362#[deprecated(note = "Use `dsl::Concat` instead")]
363pub type ConcatBinary<Lhs, Rhs> = crate::dsl::Concat<Lhs, Rhs>;
364
365#[doc(hidden)]
366#[deprecated(note = "Use `dsl::Like` instead")]
367pub type LikeBinary<Lhs, Rhs> = crate::dsl::Like<Lhs, Rhs>;
368
369#[doc(hidden)]
370#[deprecated(note = "Use `dsl::NotLike` instead")]
371pub type NotLikeBinary<Lhs, Rhs> = crate::dsl::NotLike<Lhs, Rhs>;
372
373#[doc(hidden)]
374#[deprecated(note = "Use `dsl::Concat` instead")]
375pub type ConcatArray<Lhs, Rhs> = crate::dsl::Concat<Lhs, Rhs>;
376
377#[doc(inline)]
378pub use super::return_type_helpers::*;