1#[macro_export]
2#[doc(hidden)]
3macro_rules! __diesel_operator_body {
4 (
5 notation = $notation:ident,
6 struct_name = $name:ident,
7 operator = $operator:expr_2021,
8 return_ty = (ReturnBasedOnArgs),
9 ty_params = ($($ty_param:ident,)+),
10 field_names = $field_names:tt,
11 backend_ty_params = $backend_ty_params:tt,
12 backend_ty = $backend_ty:ty,
13 ) => {
14 $crate::__diesel_operator_body! {
15 notation = $notation,
16 struct_name = $name,
17 operator = $operator,
18 return_ty = (ST),
19 ty_params = ($($ty_param,)+),
20 field_names = $field_names,
21 backend_ty_params = $backend_ty_params,
22 backend_ty = $backend_ty,
23 expression_ty_params = (ST,),
24 expression_bounds = ($($ty_param: $crate::expression::Expression<SqlType = ST>,)+),
25 }
26 };
27
28 (
29 notation = $notation:ident,
30 struct_name = $name:ident,
31 operator = $operator:expr_2021,
32 return_ty = ($($return_ty:tt)+),
33 ty_params = ($($ty_param:ident,)+),
34 field_names = $field_names:tt,
35 backend_ty_params = $backend_ty_params:tt,
36 backend_ty = $backend_ty:ty,
37 ) => {
38 $crate::__diesel_operator_body! {
39 notation = $notation,
40 struct_name = $name,
41 operator = $operator,
42 return_ty = ($($return_ty)*),
43 ty_params = ($($ty_param,)+),
44 field_names = $field_names,
45 backend_ty_params = $backend_ty_params,
46 backend_ty = $backend_ty,
47 expression_ty_params = (),
48 expression_bounds = ($($ty_param: $crate::expression::Expression,)+),
49 }
50 };
51
52 (
53 notation = $notation:ident,
54 struct_name = $name:ident,
55 operator = $operator:expr_2021,
56 return_ty = ($($return_ty:tt)+),
57 ty_params = ($($ty_param:ident,)+),
58 field_names = ($($field_name:ident,)+),
59 backend_ty_params = ($($backend_ty_param:ident,)*),
60 backend_ty = $backend_ty:ty,
61 expression_ty_params = ($($expression_ty_params:ident,)*),
62 expression_bounds = ($($expression_bounds:tt)*),
63 ) => {
64 #[derive(
65 Debug,
66 Clone,
67 Copy,
68 $crate::query_builder::QueryId,
69 $crate::sql_types::DieselNumericOps,
70 $crate::expression::ValidGrouping
71 )]
72 #[doc(hidden)]
73 #[allow(unreachable_pub)]
74 pub struct $name<$($ty_param,)+> {
75 $(pub(crate) $field_name: $ty_param,)+
76 }
77
78 impl<$($ty_param,)+> $name<$($ty_param,)+> {
79 #[allow(dead_code)]
80 pub(crate) fn new($($field_name: $ty_param,)+) -> Self {
81 $name { $($field_name,)+ }
82 }
83 }
84
85 $crate::impl_selectable_expression!($name<$($ty_param),+>);
86
87 impl<$($ty_param,)+ $($expression_ty_params,)*> $crate::expression::Expression for $name<$($ty_param,)+> where
88 $($expression_bounds)*
89 {
90 type SqlType = $($return_ty)*;
91 }
92
93 impl<$($ty_param,)+ $($backend_ty_param,)*> $crate::query_builder::QueryFragment<$backend_ty>
94 for $name<$($ty_param,)+> where
95 $($ty_param: $crate::query_builder::QueryFragment<$backend_ty>,)+
96 $($backend_ty_param: $crate::backend::Backend,)*
97 {
98 fn walk_ast<'b>(
99 &'b self,
100 mut out: $crate::query_builder::AstPass<'_, 'b, $backend_ty>
101 ) -> $crate::result::QueryResult<()>
102 {
103 $crate::__diesel_operator_to_sql!(
104 notation = $notation,
105 operator_expr = out.push_sql($operator),
106 field_exprs = ($(self.$field_name.walk_ast(out.reborrow())?),+),
107 );
108 Ok(())
109 }
110 }
111
112 impl<S, $($ty_param,)+> $crate::internal::operators_macro::FieldAliasMapper<S> for $name<$($ty_param,)+>
113 where
114 S: $crate::query_source::AliasSource,
115 $($ty_param: $crate::internal::operators_macro::FieldAliasMapper<S>,)+
116 {
117 type Out = $name<
118 $(<$ty_param as $crate::internal::operators_macro::FieldAliasMapper<S>>::Out,)+
119 >;
120 fn map(self, alias: &$crate::query_source::Alias<S>) -> Self::Out {
121 $name {
122 $($field_name: self.$field_name.map(alias),)+
123 }
124 }
125 }
126 }
127}
128
129#[macro_export]
130#[doc(hidden)]
131macro_rules! __diesel_operator_to_sql {
132 (
133 notation = infix,
134 operator_expr = $op:expr_2021,
135 field_exprs = ($left:expr_2021, $right:expr_2021),
136 ) => {
137 $left;
138 $op;
139 $right;
140 };
141
142 (
143 notation = postfix,
144 operator_expr = $op:expr_2021,
145 field_exprs = ($expr:expr_2021),
146 ) => {
147 $expr;
148 $op;
149 };
150
151 (
152 notation = prefix,
153 operator_expr = $op:expr_2021,
154 field_exprs = ($expr:expr_2021),
155 ) => {
156 $op;
157 $expr;
158 };
159}
160
161#[macro_export]
240macro_rules! infix_operator {
241 ($name:ident, $operator:expr_2021) => {
242 $crate::infix_operator!($name, $operator, $crate::sql_types::Bool);
243 };
244
245 ($name:ident, $operator:expr_2021, backend: $backend:ty) => {
246 $crate::infix_operator!($name, $operator, $crate::sql_types::Bool, backend: $backend);
247 };
248
249 ($name:ident, $operator:expr_2021, $return_ty:ty) => {
250 $crate::__diesel_infix_operator!(
251 name = $name,
252 operator = $operator,
253 return_ty = NullableBasedOnArgs ($return_ty),
254 backend_ty_params = (DB,),
255 backend_ty = DB,
256 );
257 };
258
259 ($name:ident, $operator:expr_2021, $return_ty:ty, backend: $backend:ty) => {
260 $crate::__diesel_infix_operator!(
261 name = $name,
262 operator = $operator,
263 return_ty = NullableBasedOnArgs ($return_ty),
264 backend_ty_params = (),
265 backend_ty = $backend,
266 );
267 };
268
269}
270#[macro_export]
271#[doc(hidden)]
272macro_rules! __diesel_infix_operator {
273 ($name:ident, $operator:expr_2021, ConstantNullability $return_ty:ty) => {
274 $crate::__diesel_infix_operator!(
275 name = $name,
276 operator = $operator,
277 return_ty = ($return_ty),
278 backend_ty_params = (DB,),
279 backend_ty = DB,
280 );
281 };
282 ($name:ident, $operator:expr_2021, __diesel_internal_SameResultAsInput) => {
283 $crate::__diesel_infix_operator!(
284 name = $name,
285 operator = $operator,
286 return_ty = (<T as $crate::expression::Expression>::SqlType),
287 backend_ty_params = (DB,),
288 backend_ty = DB,
289 );
290 };
291 ($name:ident, $operator:expr_2021, __diesel_internal_SameResultAsInput, backend: $backend:ty) => {
292 $crate::__diesel_infix_operator!(
293 name = $name,
294 operator = $operator,
295 return_ty = (<T as $crate::expression::Expression>::SqlType),
296 backend_ty_params = (),
297 backend_ty = $backend,
298 );
299 };
300 ($name:ident, $operator:expr_2021, ConstantNullability $return_ty:ty, backend: $backend:ty) => {
301 $crate::__diesel_infix_operator!(
302 name = $name,
303 operator = $operator,
304 return_ty = ($return_ty),
305 backend_ty_params = (),
306 backend_ty = $backend,
307 );
308 };
309
310 (
311 name = $name:ident,
312 operator = $operator:expr_2021,
313 return_ty = NullableBasedOnArgs ($($return_ty:tt)+),
314 backend_ty_params = $backend_ty_params:tt,
315 backend_ty = $backend_ty:ty,
316 ) => {
317 $crate::__diesel_infix_operator!(
318 name = $name,
319 operator = $operator,
320 return_ty = (
321 $crate::sql_types::is_nullable::MaybeNullable<
322 $crate::sql_types::is_nullable::IsOneNullable<
323 <T as $crate::expression::Expression>::SqlType,
324 <U as $crate::expression::Expression>::SqlType
325 >,
326 $($return_ty)+
327 >
328 ),
329 expression_bounds = (
330 $crate::sql_types::is_nullable::IsSqlTypeNullable<
331 <T as $crate::expression::Expression>::SqlType
332 >: $crate::sql_types::OneIsNullable<
333 $crate::sql_types::is_nullable::IsSqlTypeNullable<
334 <U as $crate::expression::Expression>::SqlType
335 >
336 >,
337 $crate::sql_types::is_nullable::IsOneNullable<
338 <T as $crate::expression::Expression>::SqlType,
339 <U as $crate::expression::Expression>::SqlType
340 >: $crate::sql_types::MaybeNullableType<$($return_ty)+>,
341 ),
342 backend_ty_params = $backend_ty_params,
343 backend_ty = $backend_ty,
344 );
345 };
346
347 (
348 name = $name:ident,
349 operator = $operator:expr_2021,
350 return_ty = ($($return_ty:tt)+),
351 backend_ty_params = $backend_ty_params:tt,
352 backend_ty = $backend_ty:ty,
353 ) => {
354 $crate::__diesel_infix_operator!(
355 name = $name,
356 operator = $operator,
357 return_ty = ($($return_ty)+),
358 expression_bounds = (),
359 backend_ty_params = $backend_ty_params,
360 backend_ty = $backend_ty,
361 );
362 };
363
364 (
365 name = $name:ident,
366 operator = $operator:expr_2021,
367 return_ty = ($($return_ty:tt)+),
368 expression_bounds = ($($expression_bounds:tt)*),
369 backend_ty_params = $backend_ty_params:tt,
370 backend_ty = $backend_ty:ty,
371 ) => {
372 $crate::__diesel_operator_body!(
373 notation = infix,
374 struct_name = $name,
375 operator = $operator,
376 return_ty = ($($return_ty)+),
377 ty_params = (T, U,),
378 field_names = (left, right,),
379 backend_ty_params = $backend_ty_params,
380 backend_ty = $backend_ty,
381 expression_ty_params = (),
382 expression_bounds = (
383 T: $crate::expression::Expression,
384 U: $crate::expression::Expression,
385 <T as $crate::expression::Expression>::SqlType: $crate::sql_types::SqlType,
386 <U as $crate::expression::Expression>::SqlType: $crate::sql_types::SqlType,
387 $($expression_bounds)*
388 ),
389 );
390 };
391}
392
393#[macro_export]
394#[deprecated(since = "2.0.0", note = "use `diesel::infix_operator!` instead")]
395#[cfg(all(feature = "with-deprecated", not(feature = "without-deprecated")))]
396#[doc(hidden)]
397macro_rules! diesel_infix_operator {
398 ($($args:tt)*) => {
399 $crate::infix_operator!($($args)*);
400 }
401}
402
403#[macro_export]
410macro_rules! postfix_operator {
411 ($name:ident, $operator:expr_2021) => {
412 $crate::postfix_operator!($name, $operator, $crate::sql_types::Bool);
413 };
414
415 ($name:ident, $operator:expr_2021, backend: $backend:ty) => {
416 $crate::postfix_operator!($name, $operator, $crate::sql_types::Bool, backend: $backend);
417 };
418
419 ($name:ident, $operator:expr_2021, ConditionalNullability $($return_ty:tt)::*) => {
420 $crate::postfix_operator!(
421 name = $name,
422 operator = $operator,
423 return_ty = NullableBasedOnArgs ($($return_ty)::*),
424 );
425 };
426
427 ($name:ident, $operator:expr_2021, ConditionalNullability $($return_ty:tt)::*, backend: $backend:ty) => {
428 $crate::postfix_operator!(
429 $name,
430 $operator,
431 return_ty = NullableBasedOnArgs ($($return_ty)::*),
432 backend: $backend
433 );
434 };
435
436 ($name:ident, $operator:expr_2021, return_ty = NullableBasedOnArgs($return_ty:ty)) => {
437 $crate::__diesel_operator_body!(
438 notation = postfix,
439 struct_name = $name,
440 operator = $operator,
441 return_ty = (
442 $crate::sql_types::is_nullable::MaybeNullable<
443 <<Expr as $crate::expression::Expression>::SqlType as $crate::sql_types::SqlType>::IsNull,
444 $return_ty
445 >
446 ),
447 ty_params = (Expr,),
448 field_names = (expr,),
449 backend_ty_params = (DB,),
450 backend_ty = DB,
451 expression_ty_params = (),
452 expression_bounds = (
453 Expr: $crate::expression::Expression,
454 <Expr as $crate::expression::Expression>::SqlType: $crate::sql_types::SqlType,
455 $crate::sql_types::is_nullable::IsOneNullable<
456 <Expr as $crate::expression::Expression>::SqlType,
457 $return_ty
458 >: $crate::sql_types::MaybeNullableType<$return_ty>,
459 ),
460 );
461 };
462
463 ($name:ident, $operator:expr_2021, return_ty = NullableBasedOnArgs($return_ty:ty), backend: $backend:ty) => {
464 $crate::__diesel_operator_body!(
465 notation = postfix,
466 struct_name = $name,
467 operator = $operator,
468 return_ty = (
469 $crate::sql_types::is_nullable::MaybeNullable<
470 $crate::sql_types::is_nullable::IsOneNullable<
471 <Expr as $crate::expression::Expression>::SqlType,
472 $return_ty
473 >,
474 $return_ty
475 >
476 ),
477 ty_params = (Expr,),
478 field_names = (expr,),
479 backend_ty_params = (),
480 backend_ty = $backend,
481 expression_ty_params = (),
482 expression_bounds = (
483 Expr: $crate::expression::Expression,
484 <Expr as $crate::expression::Expression>::SqlType: $crate::sql_types::SqlType,
485 $crate::sql_types::is_nullable::IsOneNullable<
486 <Expr as $crate::expression::Expression>::SqlType,
487 $return_ty
488 >: $crate::sql_types::MaybeNullableType<$return_ty>,
489 ),
490 );
491 };
492
493 ($name:ident, $operator:expr_2021, $return_ty:ty) => {
494 $crate::__diesel_operator_body!(
495 notation = postfix,
496 struct_name = $name,
497 operator = $operator,
498 return_ty = ($return_ty),
499 ty_params = (Expr,),
500 field_names = (expr,),
501 backend_ty_params = (DB,),
502 backend_ty = DB,
503 );
504 };
505
506 ($name:ident, $operator:expr_2021, $return_ty:ty, backend: $backend:ty) => {
507 $crate::__diesel_operator_body!(
508 notation = postfix,
509 struct_name = $name,
510 operator = $operator,
511 return_ty = ($return_ty),
512 ty_params = (Expr,),
513 field_names = (expr,),
514 backend_ty_params = (),
515 backend_ty = $backend,
516 );
517 };
518}
519
520#[macro_export]
521#[deprecated(since = "2.0.0", note = "use `diesel::postfix_operator!` instead")]
522#[cfg(all(feature = "with-deprecated", not(feature = "without-deprecated")))]
523#[doc(hidden)]
524macro_rules! diesel_postfix_operator {
525 ($($args:tt)*) => {
526 $crate::postfix_operator!($($args)*);
527 }
528}
529
530#[macro_export]
537macro_rules! prefix_operator {
538 ($name:ident, $operator:expr_2021) => {
539 $crate::prefix_operator!($name, $operator, $crate::sql_types::Bool);
540 };
541
542 ($name:ident, $operator:expr_2021, backend: $backend:ty) => {
543 $crate::prefix_operator!($name, $operator, $crate::sql_types::Bool, backend: $backend);
544 };
545
546 ($name:ident, $operator:expr_2021, $return_ty:ty) => {
547 $crate::__diesel_operator_body!(
548 notation = prefix,
549 struct_name = $name,
550 operator = $operator,
551 return_ty = (
552 $crate::sql_types::is_nullable::MaybeNullable<
553 $crate::sql_types::is_nullable::IsSqlTypeNullable<
554 <Expr as $crate::expression::Expression>::SqlType
555 >,
556 $return_ty,
557 >
558 ),
559 ty_params = (Expr,),
560 field_names = (expr,),
561 backend_ty_params = (DB,),
562 backend_ty = DB,
563 expression_ty_params = (),
564 expression_bounds = (
565 Expr: $crate::expression::Expression,
566 <Expr as $crate::expression::Expression>::SqlType: $crate::sql_types::SqlType,
567 $crate::sql_types::is_nullable::IsSqlTypeNullable<
568 <Expr as $crate::expression::Expression>::SqlType
569 >: $crate::sql_types::MaybeNullableType<$return_ty>,
570 ),
571 );
572 };
573
574 ($name:ident, $operator:expr_2021, $return_ty:ty, backend: $backend:ty) => {
575 $crate::__diesel_operator_body!(
576 notation = prefix,
577 struct_name = $name,
578 operator = $operator,
579 return_ty = (
580 $crate::sql_types::is_nullable::MaybeNullable<
581 $crate::sql_types::is_nullable::IsSqlTypeNullable<
582 <Expr as $crate::expression::Expression>::SqlType
583 >,
584 $return_ty,
585 >
586 ),
587 ty_params = (Expr,),
588 field_names = (expr,),
589 backend_ty_params = (),
590 backend_ty = $backend,
591 expression_ty_params = (),
592 expression_bounds = (
593 Expr: $crate::expression::Expression,
594 <Expr as $crate::expression::Expression>::SqlType: $crate::sql_types::SqlType,
595 $crate::sql_types::is_nullable::IsSqlTypeNullable<
596 <Expr as $crate::expression::Expression>::SqlType
597 >: $crate::sql_types::MaybeNullableType<$return_ty>,
598 ),
599 );
600 };
601}
602
603#[macro_export]
604#[deprecated(since = "2.0.0", note = "use `diesel::prefix_operator!` instead")]
605#[cfg(all(feature = "with-deprecated", not(feature = "without-deprecated")))]
606#[doc(hidden)]
607macro_rules! diesel_prefix_operator {
608 ($($args:tt)*) => {
609 $crate::prefix_operator!($($args)*);
610 }
611}
612
613#[doc(hidden)]
#[allow(unreachable_pub)]
pub struct And<T, U> {
pub(crate) left: T,
pub(crate) right: U,
}
#[automatically_derived]
#[allow(unreachable_pub)]
impl<T: ::core::fmt::Debug, U: ::core::fmt::Debug> ::core::fmt::Debug for
And<T, U> {
#[inline]
fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
::core::fmt::Formatter::debug_struct_field2_finish(f, "And", "left",
&self.left, "right", &&self.right)
}
}
#[automatically_derived]
#[allow(unreachable_pub)]
impl<T: ::core::clone::Clone, U: ::core::clone::Clone> ::core::clone::Clone
for And<T, U> {
#[inline]
fn clone(&self) -> And<T, U> {
And {
left: ::core::clone::Clone::clone(&self.left),
right: ::core::clone::Clone::clone(&self.right),
}
}
}
#[automatically_derived]
#[allow(unreachable_pub)]
impl<T: ::core::marker::Copy, U: ::core::marker::Copy> ::core::marker::Copy
for And<T, U> {
}
const _: () =
{
use diesel;
#[allow(non_camel_case_types)]
impl<T: diesel::query_builder::QueryId,
U: diesel::query_builder::QueryId> diesel::query_builder::QueryId
for And<T, U> {
type QueryId =
And<<T as diesel::query_builder::QueryId>::QueryId,
<U as diesel::query_builder::QueryId>::QueryId>;
const HAS_STATIC_QUERY_ID: bool =
<T as diesel::query_builder::QueryId>::HAS_STATIC_QUERY_ID &&
<U as diesel::query_builder::QueryId>::HAS_STATIC_QUERY_ID
&& true;
const IS_WINDOW_FUNCTION: bool =
<T as diesel::query_builder::QueryId>::IS_WINDOW_FUNCTION ||
<U as diesel::query_builder::QueryId>::IS_WINDOW_FUNCTION ||
false;
}
};
const _: () =
{
use diesel;
use diesel::internal::derives::numeric_ops as ops;
use diesel::expression::{Expression, AsExpression};
use diesel::sql_types::ops::{Add, Sub, Mul, Div};
use diesel::sql_types::{SqlType, SingleValue};
impl<T, U, __Rhs> ::core::ops::Add<__Rhs> for And<T, U> where
Self: Expression, Self: Expression,
<Self as Expression>::SqlType: Add,
<<Self as Expression>::SqlType as Add>::Rhs: SqlType +
SingleValue,
__Rhs: AsExpression<<<Self as Expression>::SqlType as Add>::Rhs> {
type Output = ops::Add<Self, __Rhs::Expression>;
fn add(self, rhs: __Rhs) -> Self::Output {
ops::Add::new(self, rhs.as_expression())
}
}
impl<T, U, __Rhs> ::core::ops::Sub<__Rhs> for And<T, U> where
Self: Expression, Self: Expression,
<Self as Expression>::SqlType: Sub,
<<Self as Expression>::SqlType as Sub>::Rhs: SqlType +
SingleValue,
__Rhs: AsExpression<<<Self as Expression>::SqlType as Sub>::Rhs> {
type Output = ops::Sub<Self, __Rhs::Expression>;
fn sub(self, rhs: __Rhs) -> Self::Output {
ops::Sub::new(self, rhs.as_expression())
}
}
impl<T, U, __Rhs> ::core::ops::Mul<__Rhs> for And<T, U> where
Self: Expression, Self: Expression,
<Self as Expression>::SqlType: Mul,
<<Self as Expression>::SqlType as Mul>::Rhs: SqlType +
SingleValue,
__Rhs: AsExpression<<<Self as Expression>::SqlType as Mul>::Rhs> {
type Output = ops::Mul<Self, __Rhs::Expression>;
fn mul(self, rhs: __Rhs) -> Self::Output {
ops::Mul::new(self, rhs.as_expression())
}
}
impl<T, U, __Rhs> ::core::ops::Div<__Rhs> for And<T, U> where
Self: Expression, Self: Expression,
<Self as Expression>::SqlType: Div,
<<Self as Expression>::SqlType as Div>::Rhs: SqlType +
SingleValue,
__Rhs: AsExpression<<<Self as Expression>::SqlType as Div>::Rhs> {
type Output = ops::Div<Self, __Rhs::Expression>;
fn div(self, rhs: __Rhs) -> Self::Output {
ops::Div::new(self, rhs.as_expression())
}
}
};
const _: () =
{
use diesel;
impl<T, U, __GroupByClause>
diesel::expression::ValidGrouping<__GroupByClause> for And<T, U>
where T: diesel::expression::ValidGrouping<__GroupByClause>,
U: diesel::expression::ValidGrouping<__GroupByClause>,
<T as
diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate: diesel::expression::MixedAggregates<<U
as
diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate>
{
type IsAggregate =
<<T as
diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate
as
diesel::expression::MixedAggregates<<U as
diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate>>::Output;
}
};
impl<T, U> And<T, U> {
#[allow(dead_code)]
pub(crate) fn new(left: T, right: U) -> Self { And { left, right } }
}
impl<T, U, QS> crate::expression::SelectableExpression<QS> for And<T, U> where
And<T, U>: crate::expression::AppearsOnTable<QS>,
T: crate::expression::SelectableExpression<QS>,
U: crate::expression::SelectableExpression<QS> {}
impl<T, U, QS> crate::expression::AppearsOnTable<QS> for And<T, U> where
And<T, U>: crate::expression::Expression,
T: crate::expression::AppearsOnTable<QS>,
U: crate::expression::AppearsOnTable<QS> {}
impl<T, U> crate::expression::Expression for And<T, U> where
T: crate::expression::Expression, U: crate::expression::Expression,
<T as crate::expression::Expression>::SqlType: crate::sql_types::SqlType,
<U as crate::expression::Expression>::SqlType: crate::sql_types::SqlType,
crate::sql_types::is_nullable::IsSqlTypeNullable<<T as
crate::expression::Expression>::SqlType>: crate::sql_types::OneIsNullable<crate::sql_types::is_nullable::IsSqlTypeNullable<<U
as crate::expression::Expression>::SqlType>>,
crate::sql_types::is_nullable::IsOneNullable<<T as
crate::expression::Expression>::SqlType,
<U as
crate::expression::Expression>::SqlType>: crate::sql_types::MaybeNullableType<crate::sql_types::Bool>
{
type SqlType =
crate::sql_types::is_nullable::MaybeNullable<crate::sql_types::is_nullable::IsOneNullable<<T
as crate::expression::Expression>::SqlType,
<U as crate::expression::Expression>::SqlType>,
crate::sql_types::Bool>;
}
impl<T, U, DB> crate::query_builder::QueryFragment<DB> for And<T, U> where
T: crate::query_builder::QueryFragment<DB>,
U: crate::query_builder::QueryFragment<DB>, DB: crate::backend::Backend {
fn walk_ast<'b>(&'b self,
mut out: crate::query_builder::AstPass<'_, 'b, DB>)
-> crate::result::QueryResult<()> {
self.left.walk_ast(out.reborrow())?;
out.push_sql(" AND ");
self.right.walk_ast(out.reborrow())?;
;
Ok(())
}
}
impl<S, T, U> crate::internal::operators_macro::FieldAliasMapper<S> for
And<T, U> where S: crate::query_source::AliasSource,
T: crate::internal::operators_macro::FieldAliasMapper<S>,
U: crate::internal::operators_macro::FieldAliasMapper<S> {
type Out =
And<<T as crate::internal::operators_macro::FieldAliasMapper<S>>::Out,
<U as crate::internal::operators_macro::FieldAliasMapper<S>>::Out>;
fn map(self, alias: &crate::query_source::Alias<S>) -> Self::Out {
And { left: self.left.map(alias), right: self.right.map(alias) }
}
}infix_operator!(And, " AND ");
614#[doc(hidden)]
#[allow(unreachable_pub)]
pub struct Or<T, U> {
pub(crate) left: T,
pub(crate) right: U,
}
#[automatically_derived]
#[allow(unreachable_pub)]
impl<T: ::core::fmt::Debug, U: ::core::fmt::Debug> ::core::fmt::Debug for
Or<T, U> {
#[inline]
fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
::core::fmt::Formatter::debug_struct_field2_finish(f, "Or", "left",
&self.left, "right", &&self.right)
}
}
#[automatically_derived]
#[allow(unreachable_pub)]
impl<T: ::core::clone::Clone, U: ::core::clone::Clone> ::core::clone::Clone
for Or<T, U> {
#[inline]
fn clone(&self) -> Or<T, U> {
Or {
left: ::core::clone::Clone::clone(&self.left),
right: ::core::clone::Clone::clone(&self.right),
}
}
}
#[automatically_derived]
#[allow(unreachable_pub)]
impl<T: ::core::marker::Copy, U: ::core::marker::Copy> ::core::marker::Copy
for Or<T, U> {
}
const _: () =
{
use diesel;
#[allow(non_camel_case_types)]
impl<T: diesel::query_builder::QueryId,
U: diesel::query_builder::QueryId> diesel::query_builder::QueryId
for Or<T, U> {
type QueryId =
Or<<T as diesel::query_builder::QueryId>::QueryId,
<U as diesel::query_builder::QueryId>::QueryId>;
const HAS_STATIC_QUERY_ID: bool =
<T as diesel::query_builder::QueryId>::HAS_STATIC_QUERY_ID &&
<U as diesel::query_builder::QueryId>::HAS_STATIC_QUERY_ID
&& true;
const IS_WINDOW_FUNCTION: bool =
<T as diesel::query_builder::QueryId>::IS_WINDOW_FUNCTION ||
<U as diesel::query_builder::QueryId>::IS_WINDOW_FUNCTION ||
false;
}
};
const _: () =
{
use diesel;
use diesel::internal::derives::numeric_ops as ops;
use diesel::expression::{Expression, AsExpression};
use diesel::sql_types::ops::{Add, Sub, Mul, Div};
use diesel::sql_types::{SqlType, SingleValue};
impl<T, U, __Rhs> ::core::ops::Add<__Rhs> for Or<T, U> where
Self: Expression, Self: Expression,
<Self as Expression>::SqlType: Add,
<<Self as Expression>::SqlType as Add>::Rhs: SqlType +
SingleValue,
__Rhs: AsExpression<<<Self as Expression>::SqlType as Add>::Rhs> {
type Output = ops::Add<Self, __Rhs::Expression>;
fn add(self, rhs: __Rhs) -> Self::Output {
ops::Add::new(self, rhs.as_expression())
}
}
impl<T, U, __Rhs> ::core::ops::Sub<__Rhs> for Or<T, U> where
Self: Expression, Self: Expression,
<Self as Expression>::SqlType: Sub,
<<Self as Expression>::SqlType as Sub>::Rhs: SqlType +
SingleValue,
__Rhs: AsExpression<<<Self as Expression>::SqlType as Sub>::Rhs> {
type Output = ops::Sub<Self, __Rhs::Expression>;
fn sub(self, rhs: __Rhs) -> Self::Output {
ops::Sub::new(self, rhs.as_expression())
}
}
impl<T, U, __Rhs> ::core::ops::Mul<__Rhs> for Or<T, U> where
Self: Expression, Self: Expression,
<Self as Expression>::SqlType: Mul,
<<Self as Expression>::SqlType as Mul>::Rhs: SqlType +
SingleValue,
__Rhs: AsExpression<<<Self as Expression>::SqlType as Mul>::Rhs> {
type Output = ops::Mul<Self, __Rhs::Expression>;
fn mul(self, rhs: __Rhs) -> Self::Output {
ops::Mul::new(self, rhs.as_expression())
}
}
impl<T, U, __Rhs> ::core::ops::Div<__Rhs> for Or<T, U> where
Self: Expression, Self: Expression,
<Self as Expression>::SqlType: Div,
<<Self as Expression>::SqlType as Div>::Rhs: SqlType +
SingleValue,
__Rhs: AsExpression<<<Self as Expression>::SqlType as Div>::Rhs> {
type Output = ops::Div<Self, __Rhs::Expression>;
fn div(self, rhs: __Rhs) -> Self::Output {
ops::Div::new(self, rhs.as_expression())
}
}
};
const _: () =
{
use diesel;
impl<T, U, __GroupByClause>
diesel::expression::ValidGrouping<__GroupByClause> for Or<T, U>
where T: diesel::expression::ValidGrouping<__GroupByClause>,
U: diesel::expression::ValidGrouping<__GroupByClause>,
<T as
diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate: diesel::expression::MixedAggregates<<U
as
diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate>
{
type IsAggregate =
<<T as
diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate
as
diesel::expression::MixedAggregates<<U as
diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate>>::Output;
}
};
impl<T, U> Or<T, U> {
#[allow(dead_code)]
pub(crate) fn new(left: T, right: U) -> Self { Or { left, right } }
}
impl<T, U, QS> crate::expression::SelectableExpression<QS> for Or<T, U> where
Or<T, U>: crate::expression::AppearsOnTable<QS>,
T: crate::expression::SelectableExpression<QS>,
U: crate::expression::SelectableExpression<QS> {}
impl<T, U, QS> crate::expression::AppearsOnTable<QS> for Or<T, U> where
Or<T, U>: crate::expression::Expression,
T: crate::expression::AppearsOnTable<QS>,
U: crate::expression::AppearsOnTable<QS> {}
impl<T, U> crate::expression::Expression for Or<T, U> where
T: crate::expression::Expression, U: crate::expression::Expression,
<T as crate::expression::Expression>::SqlType: crate::sql_types::SqlType,
<U as crate::expression::Expression>::SqlType: crate::sql_types::SqlType,
crate::sql_types::is_nullable::IsSqlTypeNullable<<T as
crate::expression::Expression>::SqlType>: crate::sql_types::OneIsNullable<crate::sql_types::is_nullable::IsSqlTypeNullable<<U
as crate::expression::Expression>::SqlType>>,
crate::sql_types::is_nullable::IsOneNullable<<T as
crate::expression::Expression>::SqlType,
<U as
crate::expression::Expression>::SqlType>: crate::sql_types::MaybeNullableType<crate::sql_types::Bool>
{
type SqlType =
crate::sql_types::is_nullable::MaybeNullable<crate::sql_types::is_nullable::IsOneNullable<<T
as crate::expression::Expression>::SqlType,
<U as crate::expression::Expression>::SqlType>,
crate::sql_types::Bool>;
}
impl<T, U, DB> crate::query_builder::QueryFragment<DB> for Or<T, U> where
T: crate::query_builder::QueryFragment<DB>,
U: crate::query_builder::QueryFragment<DB>, DB: crate::backend::Backend {
fn walk_ast<'b>(&'b self,
mut out: crate::query_builder::AstPass<'_, 'b, DB>)
-> crate::result::QueryResult<()> {
self.left.walk_ast(out.reborrow())?;
out.push_sql(" OR ");
self.right.walk_ast(out.reborrow())?;
;
Ok(())
}
}
impl<S, T, U> crate::internal::operators_macro::FieldAliasMapper<S> for
Or<T, U> where S: crate::query_source::AliasSource,
T: crate::internal::operators_macro::FieldAliasMapper<S>,
U: crate::internal::operators_macro::FieldAliasMapper<S> {
type Out =
Or<<T as crate::internal::operators_macro::FieldAliasMapper<S>>::Out,
<U as crate::internal::operators_macro::FieldAliasMapper<S>>::Out>;
fn map(self, alias: &crate::query_source::Alias<S>) -> Self::Out {
Or { left: self.left.map(alias), right: self.right.map(alias) }
}
}infix_operator!(Or, " OR ");
615#[doc(hidden)]
#[allow(unreachable_pub)]
pub struct Escape<T, U> {
pub(crate) left: T,
pub(crate) right: U,
}
#[automatically_derived]
#[allow(unreachable_pub)]
impl<T: ::core::fmt::Debug, U: ::core::fmt::Debug> ::core::fmt::Debug for
Escape<T, U> {
#[inline]
fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
::core::fmt::Formatter::debug_struct_field2_finish(f, "Escape",
"left", &self.left, "right", &&self.right)
}
}
#[automatically_derived]
#[allow(unreachable_pub)]
impl<T: ::core::clone::Clone, U: ::core::clone::Clone> ::core::clone::Clone
for Escape<T, U> {
#[inline]
fn clone(&self) -> Escape<T, U> {
Escape {
left: ::core::clone::Clone::clone(&self.left),
right: ::core::clone::Clone::clone(&self.right),
}
}
}
#[automatically_derived]
#[allow(unreachable_pub)]
impl<T: ::core::marker::Copy, U: ::core::marker::Copy> ::core::marker::Copy
for Escape<T, U> {
}
const _: () =
{
use diesel;
#[allow(non_camel_case_types)]
impl<T: diesel::query_builder::QueryId,
U: diesel::query_builder::QueryId> diesel::query_builder::QueryId
for Escape<T, U> {
type QueryId =
Escape<<T as diesel::query_builder::QueryId>::QueryId,
<U as diesel::query_builder::QueryId>::QueryId>;
const HAS_STATIC_QUERY_ID: bool =
<T as diesel::query_builder::QueryId>::HAS_STATIC_QUERY_ID &&
<U as diesel::query_builder::QueryId>::HAS_STATIC_QUERY_ID
&& true;
const IS_WINDOW_FUNCTION: bool =
<T as diesel::query_builder::QueryId>::IS_WINDOW_FUNCTION ||
<U as diesel::query_builder::QueryId>::IS_WINDOW_FUNCTION ||
false;
}
};
const _: () =
{
use diesel;
use diesel::internal::derives::numeric_ops as ops;
use diesel::expression::{Expression, AsExpression};
use diesel::sql_types::ops::{Add, Sub, Mul, Div};
use diesel::sql_types::{SqlType, SingleValue};
impl<T, U, __Rhs> ::core::ops::Add<__Rhs> for Escape<T, U> where
Self: Expression, Self: Expression,
<Self as Expression>::SqlType: Add,
<<Self as Expression>::SqlType as Add>::Rhs: SqlType +
SingleValue,
__Rhs: AsExpression<<<Self as Expression>::SqlType as Add>::Rhs> {
type Output = ops::Add<Self, __Rhs::Expression>;
fn add(self, rhs: __Rhs) -> Self::Output {
ops::Add::new(self, rhs.as_expression())
}
}
impl<T, U, __Rhs> ::core::ops::Sub<__Rhs> for Escape<T, U> where
Self: Expression, Self: Expression,
<Self as Expression>::SqlType: Sub,
<<Self as Expression>::SqlType as Sub>::Rhs: SqlType +
SingleValue,
__Rhs: AsExpression<<<Self as Expression>::SqlType as Sub>::Rhs> {
type Output = ops::Sub<Self, __Rhs::Expression>;
fn sub(self, rhs: __Rhs) -> Self::Output {
ops::Sub::new(self, rhs.as_expression())
}
}
impl<T, U, __Rhs> ::core::ops::Mul<__Rhs> for Escape<T, U> where
Self: Expression, Self: Expression,
<Self as Expression>::SqlType: Mul,
<<Self as Expression>::SqlType as Mul>::Rhs: SqlType +
SingleValue,
__Rhs: AsExpression<<<Self as Expression>::SqlType as Mul>::Rhs> {
type Output = ops::Mul<Self, __Rhs::Expression>;
fn mul(self, rhs: __Rhs) -> Self::Output {
ops::Mul::new(self, rhs.as_expression())
}
}
impl<T, U, __Rhs> ::core::ops::Div<__Rhs> for Escape<T, U> where
Self: Expression, Self: Expression,
<Self as Expression>::SqlType: Div,
<<Self as Expression>::SqlType as Div>::Rhs: SqlType +
SingleValue,
__Rhs: AsExpression<<<Self as Expression>::SqlType as Div>::Rhs> {
type Output = ops::Div<Self, __Rhs::Expression>;
fn div(self, rhs: __Rhs) -> Self::Output {
ops::Div::new(self, rhs.as_expression())
}
}
};
const _: () =
{
use diesel;
impl<T, U, __GroupByClause>
diesel::expression::ValidGrouping<__GroupByClause> for
Escape<T, U> where
T: diesel::expression::ValidGrouping<__GroupByClause>,
U: diesel::expression::ValidGrouping<__GroupByClause>,
<T as
diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate: diesel::expression::MixedAggregates<<U
as
diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate>
{
type IsAggregate =
<<T as
diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate
as
diesel::expression::MixedAggregates<<U as
diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate>>::Output;
}
};
impl<T, U> Escape<T, U> {
#[allow(dead_code)]
pub(crate) fn new(left: T, right: U) -> Self { Escape { left, right } }
}
impl<T, U, QS> crate::expression::SelectableExpression<QS> for Escape<T, U>
where Escape<T, U>: crate::expression::AppearsOnTable<QS>,
T: crate::expression::SelectableExpression<QS>,
U: crate::expression::SelectableExpression<QS> {}
impl<T, U, QS> crate::expression::AppearsOnTable<QS> for Escape<T, U> where
Escape<T, U>: crate::expression::Expression,
T: crate::expression::AppearsOnTable<QS>,
U: crate::expression::AppearsOnTable<QS> {}
impl<T, U> crate::expression::Expression for Escape<T, U> where
T: crate::expression::Expression, U: crate::expression::Expression,
<T as crate::expression::Expression>::SqlType: crate::sql_types::SqlType,
<U as crate::expression::Expression>::SqlType: crate::sql_types::SqlType,
crate::sql_types::is_nullable::IsSqlTypeNullable<<T as
crate::expression::Expression>::SqlType>: crate::sql_types::OneIsNullable<crate::sql_types::is_nullable::IsSqlTypeNullable<<U
as crate::expression::Expression>::SqlType>>,
crate::sql_types::is_nullable::IsOneNullable<<T as
crate::expression::Expression>::SqlType,
<U as
crate::expression::Expression>::SqlType>: crate::sql_types::MaybeNullableType<crate::sql_types::Bool>
{
type SqlType =
crate::sql_types::is_nullable::MaybeNullable<crate::sql_types::is_nullable::IsOneNullable<<T
as crate::expression::Expression>::SqlType,
<U as crate::expression::Expression>::SqlType>,
crate::sql_types::Bool>;
}
impl<T, U, DB> crate::query_builder::QueryFragment<DB> for Escape<T, U> where
T: crate::query_builder::QueryFragment<DB>,
U: crate::query_builder::QueryFragment<DB>, DB: crate::backend::Backend {
fn walk_ast<'b>(&'b self,
mut out: crate::query_builder::AstPass<'_, 'b, DB>)
-> crate::result::QueryResult<()> {
self.left.walk_ast(out.reborrow())?;
out.push_sql(" ESCAPE ");
self.right.walk_ast(out.reborrow())?;
;
Ok(())
}
}
impl<S, T, U> crate::internal::operators_macro::FieldAliasMapper<S> for
Escape<T, U> where S: crate::query_source::AliasSource,
T: crate::internal::operators_macro::FieldAliasMapper<S>,
U: crate::internal::operators_macro::FieldAliasMapper<S> {
type Out =
Escape<<T as
crate::internal::operators_macro::FieldAliasMapper<S>>::Out,
<U as crate::internal::operators_macro::FieldAliasMapper<S>>::Out>;
fn map(self, alias: &crate::query_source::Alias<S>) -> Self::Out {
Escape { left: self.left.map(alias), right: self.right.map(alias) }
}
}infix_operator!(Escape, " ESCAPE ");
616#[doc(hidden)]
#[allow(unreachable_pub)]
pub struct Eq<T, U> {
pub(crate) left: T,
pub(crate) right: U,
}
#[automatically_derived]
#[allow(unreachable_pub)]
impl<T: ::core::fmt::Debug, U: ::core::fmt::Debug> ::core::fmt::Debug for
Eq<T, U> {
#[inline]
fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
::core::fmt::Formatter::debug_struct_field2_finish(f, "Eq", "left",
&self.left, "right", &&self.right)
}
}
#[automatically_derived]
#[allow(unreachable_pub)]
impl<T: ::core::clone::Clone, U: ::core::clone::Clone> ::core::clone::Clone
for Eq<T, U> {
#[inline]
fn clone(&self) -> Eq<T, U> {
Eq {
left: ::core::clone::Clone::clone(&self.left),
right: ::core::clone::Clone::clone(&self.right),
}
}
}
#[automatically_derived]
#[allow(unreachable_pub)]
impl<T: ::core::marker::Copy, U: ::core::marker::Copy> ::core::marker::Copy
for Eq<T, U> {
}
const _: () =
{
use diesel;
#[allow(non_camel_case_types)]
impl<T: diesel::query_builder::QueryId,
U: diesel::query_builder::QueryId> diesel::query_builder::QueryId
for Eq<T, U> {
type QueryId =
Eq<<T as diesel::query_builder::QueryId>::QueryId,
<U as diesel::query_builder::QueryId>::QueryId>;
const HAS_STATIC_QUERY_ID: bool =
<T as diesel::query_builder::QueryId>::HAS_STATIC_QUERY_ID &&
<U as diesel::query_builder::QueryId>::HAS_STATIC_QUERY_ID
&& true;
const IS_WINDOW_FUNCTION: bool =
<T as diesel::query_builder::QueryId>::IS_WINDOW_FUNCTION ||
<U as diesel::query_builder::QueryId>::IS_WINDOW_FUNCTION ||
false;
}
};
const _: () =
{
use diesel;
use diesel::internal::derives::numeric_ops as ops;
use diesel::expression::{Expression, AsExpression};
use diesel::sql_types::ops::{Add, Sub, Mul, Div};
use diesel::sql_types::{SqlType, SingleValue};
impl<T, U, __Rhs> ::core::ops::Add<__Rhs> for Eq<T, U> where
Self: Expression, Self: Expression,
<Self as Expression>::SqlType: Add,
<<Self as Expression>::SqlType as Add>::Rhs: SqlType +
SingleValue,
__Rhs: AsExpression<<<Self as Expression>::SqlType as Add>::Rhs> {
type Output = ops::Add<Self, __Rhs::Expression>;
fn add(self, rhs: __Rhs) -> Self::Output {
ops::Add::new(self, rhs.as_expression())
}
}
impl<T, U, __Rhs> ::core::ops::Sub<__Rhs> for Eq<T, U> where
Self: Expression, Self: Expression,
<Self as Expression>::SqlType: Sub,
<<Self as Expression>::SqlType as Sub>::Rhs: SqlType +
SingleValue,
__Rhs: AsExpression<<<Self as Expression>::SqlType as Sub>::Rhs> {
type Output = ops::Sub<Self, __Rhs::Expression>;
fn sub(self, rhs: __Rhs) -> Self::Output {
ops::Sub::new(self, rhs.as_expression())
}
}
impl<T, U, __Rhs> ::core::ops::Mul<__Rhs> for Eq<T, U> where
Self: Expression, Self: Expression,
<Self as Expression>::SqlType: Mul,
<<Self as Expression>::SqlType as Mul>::Rhs: SqlType +
SingleValue,
__Rhs: AsExpression<<<Self as Expression>::SqlType as Mul>::Rhs> {
type Output = ops::Mul<Self, __Rhs::Expression>;
fn mul(self, rhs: __Rhs) -> Self::Output {
ops::Mul::new(self, rhs.as_expression())
}
}
impl<T, U, __Rhs> ::core::ops::Div<__Rhs> for Eq<T, U> where
Self: Expression, Self: Expression,
<Self as Expression>::SqlType: Div,
<<Self as Expression>::SqlType as Div>::Rhs: SqlType +
SingleValue,
__Rhs: AsExpression<<<Self as Expression>::SqlType as Div>::Rhs> {
type Output = ops::Div<Self, __Rhs::Expression>;
fn div(self, rhs: __Rhs) -> Self::Output {
ops::Div::new(self, rhs.as_expression())
}
}
};
const _: () =
{
use diesel;
impl<T, U, __GroupByClause>
diesel::expression::ValidGrouping<__GroupByClause> for Eq<T, U>
where T: diesel::expression::ValidGrouping<__GroupByClause>,
U: diesel::expression::ValidGrouping<__GroupByClause>,
<T as
diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate: diesel::expression::MixedAggregates<<U
as
diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate>
{
type IsAggregate =
<<T as
diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate
as
diesel::expression::MixedAggregates<<U as
diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate>>::Output;
}
};
impl<T, U> Eq<T, U> {
#[allow(dead_code)]
pub(crate) fn new(left: T, right: U) -> Self { Eq { left, right } }
}
impl<T, U, QS> crate::expression::SelectableExpression<QS> for Eq<T, U> where
Eq<T, U>: crate::expression::AppearsOnTable<QS>,
T: crate::expression::SelectableExpression<QS>,
U: crate::expression::SelectableExpression<QS> {}
impl<T, U, QS> crate::expression::AppearsOnTable<QS> for Eq<T, U> where
Eq<T, U>: crate::expression::Expression,
T: crate::expression::AppearsOnTable<QS>,
U: crate::expression::AppearsOnTable<QS> {}
impl<T, U> crate::expression::Expression for Eq<T, U> where
T: crate::expression::Expression, U: crate::expression::Expression,
<T as crate::expression::Expression>::SqlType: crate::sql_types::SqlType,
<U as crate::expression::Expression>::SqlType: crate::sql_types::SqlType,
crate::sql_types::is_nullable::IsSqlTypeNullable<<T as
crate::expression::Expression>::SqlType>: crate::sql_types::OneIsNullable<crate::sql_types::is_nullable::IsSqlTypeNullable<<U
as crate::expression::Expression>::SqlType>>,
crate::sql_types::is_nullable::IsOneNullable<<T as
crate::expression::Expression>::SqlType,
<U as
crate::expression::Expression>::SqlType>: crate::sql_types::MaybeNullableType<crate::sql_types::Bool>
{
type SqlType =
crate::sql_types::is_nullable::MaybeNullable<crate::sql_types::is_nullable::IsOneNullable<<T
as crate::expression::Expression>::SqlType,
<U as crate::expression::Expression>::SqlType>,
crate::sql_types::Bool>;
}
impl<T, U, DB> crate::query_builder::QueryFragment<DB> for Eq<T, U> where
T: crate::query_builder::QueryFragment<DB>,
U: crate::query_builder::QueryFragment<DB>, DB: crate::backend::Backend {
fn walk_ast<'b>(&'b self,
mut out: crate::query_builder::AstPass<'_, 'b, DB>)
-> crate::result::QueryResult<()> {
self.left.walk_ast(out.reborrow())?;
out.push_sql(" = ");
self.right.walk_ast(out.reborrow())?;
;
Ok(())
}
}
impl<S, T, U> crate::internal::operators_macro::FieldAliasMapper<S> for
Eq<T, U> where S: crate::query_source::AliasSource,
T: crate::internal::operators_macro::FieldAliasMapper<S>,
U: crate::internal::operators_macro::FieldAliasMapper<S> {
type Out =
Eq<<T as crate::internal::operators_macro::FieldAliasMapper<S>>::Out,
<U as crate::internal::operators_macro::FieldAliasMapper<S>>::Out>;
fn map(self, alias: &crate::query_source::Alias<S>) -> Self::Out {
Eq { left: self.left.map(alias), right: self.right.map(alias) }
}
}infix_operator!(Eq, " = ");
617#[doc(hidden)]
#[allow(unreachable_pub)]
pub struct Gt<T, U> {
pub(crate) left: T,
pub(crate) right: U,
}
#[automatically_derived]
#[allow(unreachable_pub)]
impl<T: ::core::fmt::Debug, U: ::core::fmt::Debug> ::core::fmt::Debug for
Gt<T, U> {
#[inline]
fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
::core::fmt::Formatter::debug_struct_field2_finish(f, "Gt", "left",
&self.left, "right", &&self.right)
}
}
#[automatically_derived]
#[allow(unreachable_pub)]
impl<T: ::core::clone::Clone, U: ::core::clone::Clone> ::core::clone::Clone
for Gt<T, U> {
#[inline]
fn clone(&self) -> Gt<T, U> {
Gt {
left: ::core::clone::Clone::clone(&self.left),
right: ::core::clone::Clone::clone(&self.right),
}
}
}
#[automatically_derived]
#[allow(unreachable_pub)]
impl<T: ::core::marker::Copy, U: ::core::marker::Copy> ::core::marker::Copy
for Gt<T, U> {
}
const _: () =
{
use diesel;
#[allow(non_camel_case_types)]
impl<T: diesel::query_builder::QueryId,
U: diesel::query_builder::QueryId> diesel::query_builder::QueryId
for Gt<T, U> {
type QueryId =
Gt<<T as diesel::query_builder::QueryId>::QueryId,
<U as diesel::query_builder::QueryId>::QueryId>;
const HAS_STATIC_QUERY_ID: bool =
<T as diesel::query_builder::QueryId>::HAS_STATIC_QUERY_ID &&
<U as diesel::query_builder::QueryId>::HAS_STATIC_QUERY_ID
&& true;
const IS_WINDOW_FUNCTION: bool =
<T as diesel::query_builder::QueryId>::IS_WINDOW_FUNCTION ||
<U as diesel::query_builder::QueryId>::IS_WINDOW_FUNCTION ||
false;
}
};
const _: () =
{
use diesel;
use diesel::internal::derives::numeric_ops as ops;
use diesel::expression::{Expression, AsExpression};
use diesel::sql_types::ops::{Add, Sub, Mul, Div};
use diesel::sql_types::{SqlType, SingleValue};
impl<T, U, __Rhs> ::core::ops::Add<__Rhs> for Gt<T, U> where
Self: Expression, Self: Expression,
<Self as Expression>::SqlType: Add,
<<Self as Expression>::SqlType as Add>::Rhs: SqlType +
SingleValue,
__Rhs: AsExpression<<<Self as Expression>::SqlType as Add>::Rhs> {
type Output = ops::Add<Self, __Rhs::Expression>;
fn add(self, rhs: __Rhs) -> Self::Output {
ops::Add::new(self, rhs.as_expression())
}
}
impl<T, U, __Rhs> ::core::ops::Sub<__Rhs> for Gt<T, U> where
Self: Expression, Self: Expression,
<Self as Expression>::SqlType: Sub,
<<Self as Expression>::SqlType as Sub>::Rhs: SqlType +
SingleValue,
__Rhs: AsExpression<<<Self as Expression>::SqlType as Sub>::Rhs> {
type Output = ops::Sub<Self, __Rhs::Expression>;
fn sub(self, rhs: __Rhs) -> Self::Output {
ops::Sub::new(self, rhs.as_expression())
}
}
impl<T, U, __Rhs> ::core::ops::Mul<__Rhs> for Gt<T, U> where
Self: Expression, Self: Expression,
<Self as Expression>::SqlType: Mul,
<<Self as Expression>::SqlType as Mul>::Rhs: SqlType +
SingleValue,
__Rhs: AsExpression<<<Self as Expression>::SqlType as Mul>::Rhs> {
type Output = ops::Mul<Self, __Rhs::Expression>;
fn mul(self, rhs: __Rhs) -> Self::Output {
ops::Mul::new(self, rhs.as_expression())
}
}
impl<T, U, __Rhs> ::core::ops::Div<__Rhs> for Gt<T, U> where
Self: Expression, Self: Expression,
<Self as Expression>::SqlType: Div,
<<Self as Expression>::SqlType as Div>::Rhs: SqlType +
SingleValue,
__Rhs: AsExpression<<<Self as Expression>::SqlType as Div>::Rhs> {
type Output = ops::Div<Self, __Rhs::Expression>;
fn div(self, rhs: __Rhs) -> Self::Output {
ops::Div::new(self, rhs.as_expression())
}
}
};
const _: () =
{
use diesel;
impl<T, U, __GroupByClause>
diesel::expression::ValidGrouping<__GroupByClause> for Gt<T, U>
where T: diesel::expression::ValidGrouping<__GroupByClause>,
U: diesel::expression::ValidGrouping<__GroupByClause>,
<T as
diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate: diesel::expression::MixedAggregates<<U
as
diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate>
{
type IsAggregate =
<<T as
diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate
as
diesel::expression::MixedAggregates<<U as
diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate>>::Output;
}
};
impl<T, U> Gt<T, U> {
#[allow(dead_code)]
pub(crate) fn new(left: T, right: U) -> Self { Gt { left, right } }
}
impl<T, U, QS> crate::expression::SelectableExpression<QS> for Gt<T, U> where
Gt<T, U>: crate::expression::AppearsOnTable<QS>,
T: crate::expression::SelectableExpression<QS>,
U: crate::expression::SelectableExpression<QS> {}
impl<T, U, QS> crate::expression::AppearsOnTable<QS> for Gt<T, U> where
Gt<T, U>: crate::expression::Expression,
T: crate::expression::AppearsOnTable<QS>,
U: crate::expression::AppearsOnTable<QS> {}
impl<T, U> crate::expression::Expression for Gt<T, U> where
T: crate::expression::Expression, U: crate::expression::Expression,
<T as crate::expression::Expression>::SqlType: crate::sql_types::SqlType,
<U as crate::expression::Expression>::SqlType: crate::sql_types::SqlType,
crate::sql_types::is_nullable::IsSqlTypeNullable<<T as
crate::expression::Expression>::SqlType>: crate::sql_types::OneIsNullable<crate::sql_types::is_nullable::IsSqlTypeNullable<<U
as crate::expression::Expression>::SqlType>>,
crate::sql_types::is_nullable::IsOneNullable<<T as
crate::expression::Expression>::SqlType,
<U as
crate::expression::Expression>::SqlType>: crate::sql_types::MaybeNullableType<crate::sql_types::Bool>
{
type SqlType =
crate::sql_types::is_nullable::MaybeNullable<crate::sql_types::is_nullable::IsOneNullable<<T
as crate::expression::Expression>::SqlType,
<U as crate::expression::Expression>::SqlType>,
crate::sql_types::Bool>;
}
impl<T, U, DB> crate::query_builder::QueryFragment<DB> for Gt<T, U> where
T: crate::query_builder::QueryFragment<DB>,
U: crate::query_builder::QueryFragment<DB>, DB: crate::backend::Backend {
fn walk_ast<'b>(&'b self,
mut out: crate::query_builder::AstPass<'_, 'b, DB>)
-> crate::result::QueryResult<()> {
self.left.walk_ast(out.reborrow())?;
out.push_sql(" > ");
self.right.walk_ast(out.reborrow())?;
;
Ok(())
}
}
impl<S, T, U> crate::internal::operators_macro::FieldAliasMapper<S> for
Gt<T, U> where S: crate::query_source::AliasSource,
T: crate::internal::operators_macro::FieldAliasMapper<S>,
U: crate::internal::operators_macro::FieldAliasMapper<S> {
type Out =
Gt<<T as crate::internal::operators_macro::FieldAliasMapper<S>>::Out,
<U as crate::internal::operators_macro::FieldAliasMapper<S>>::Out>;
fn map(self, alias: &crate::query_source::Alias<S>) -> Self::Out {
Gt { left: self.left.map(alias), right: self.right.map(alias) }
}
}infix_operator!(Gt, " > ");
618#[doc(hidden)]
#[allow(unreachable_pub)]
pub struct GtEq<T, U> {
pub(crate) left: T,
pub(crate) right: U,
}
#[automatically_derived]
#[allow(unreachable_pub)]
impl<T: ::core::fmt::Debug, U: ::core::fmt::Debug> ::core::fmt::Debug for
GtEq<T, U> {
#[inline]
fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
::core::fmt::Formatter::debug_struct_field2_finish(f, "GtEq", "left",
&self.left, "right", &&self.right)
}
}
#[automatically_derived]
#[allow(unreachable_pub)]
impl<T: ::core::clone::Clone, U: ::core::clone::Clone> ::core::clone::Clone
for GtEq<T, U> {
#[inline]
fn clone(&self) -> GtEq<T, U> {
GtEq {
left: ::core::clone::Clone::clone(&self.left),
right: ::core::clone::Clone::clone(&self.right),
}
}
}
#[automatically_derived]
#[allow(unreachable_pub)]
impl<T: ::core::marker::Copy, U: ::core::marker::Copy> ::core::marker::Copy
for GtEq<T, U> {
}
const _: () =
{
use diesel;
#[allow(non_camel_case_types)]
impl<T: diesel::query_builder::QueryId,
U: diesel::query_builder::QueryId> diesel::query_builder::QueryId
for GtEq<T, U> {
type QueryId =
GtEq<<T as diesel::query_builder::QueryId>::QueryId,
<U as diesel::query_builder::QueryId>::QueryId>;
const HAS_STATIC_QUERY_ID: bool =
<T as diesel::query_builder::QueryId>::HAS_STATIC_QUERY_ID &&
<U as diesel::query_builder::QueryId>::HAS_STATIC_QUERY_ID
&& true;
const IS_WINDOW_FUNCTION: bool =
<T as diesel::query_builder::QueryId>::IS_WINDOW_FUNCTION ||
<U as diesel::query_builder::QueryId>::IS_WINDOW_FUNCTION ||
false;
}
};
const _: () =
{
use diesel;
use diesel::internal::derives::numeric_ops as ops;
use diesel::expression::{Expression, AsExpression};
use diesel::sql_types::ops::{Add, Sub, Mul, Div};
use diesel::sql_types::{SqlType, SingleValue};
impl<T, U, __Rhs> ::core::ops::Add<__Rhs> for GtEq<T, U> where
Self: Expression, Self: Expression,
<Self as Expression>::SqlType: Add,
<<Self as Expression>::SqlType as Add>::Rhs: SqlType +
SingleValue,
__Rhs: AsExpression<<<Self as Expression>::SqlType as Add>::Rhs> {
type Output = ops::Add<Self, __Rhs::Expression>;
fn add(self, rhs: __Rhs) -> Self::Output {
ops::Add::new(self, rhs.as_expression())
}
}
impl<T, U, __Rhs> ::core::ops::Sub<__Rhs> for GtEq<T, U> where
Self: Expression, Self: Expression,
<Self as Expression>::SqlType: Sub,
<<Self as Expression>::SqlType as Sub>::Rhs: SqlType +
SingleValue,
__Rhs: AsExpression<<<Self as Expression>::SqlType as Sub>::Rhs> {
type Output = ops::Sub<Self, __Rhs::Expression>;
fn sub(self, rhs: __Rhs) -> Self::Output {
ops::Sub::new(self, rhs.as_expression())
}
}
impl<T, U, __Rhs> ::core::ops::Mul<__Rhs> for GtEq<T, U> where
Self: Expression, Self: Expression,
<Self as Expression>::SqlType: Mul,
<<Self as Expression>::SqlType as Mul>::Rhs: SqlType +
SingleValue,
__Rhs: AsExpression<<<Self as Expression>::SqlType as Mul>::Rhs> {
type Output = ops::Mul<Self, __Rhs::Expression>;
fn mul(self, rhs: __Rhs) -> Self::Output {
ops::Mul::new(self, rhs.as_expression())
}
}
impl<T, U, __Rhs> ::core::ops::Div<__Rhs> for GtEq<T, U> where
Self: Expression, Self: Expression,
<Self as Expression>::SqlType: Div,
<<Self as Expression>::SqlType as Div>::Rhs: SqlType +
SingleValue,
__Rhs: AsExpression<<<Self as Expression>::SqlType as Div>::Rhs> {
type Output = ops::Div<Self, __Rhs::Expression>;
fn div(self, rhs: __Rhs) -> Self::Output {
ops::Div::new(self, rhs.as_expression())
}
}
};
const _: () =
{
use diesel;
impl<T, U, __GroupByClause>
diesel::expression::ValidGrouping<__GroupByClause> for GtEq<T, U>
where T: diesel::expression::ValidGrouping<__GroupByClause>,
U: diesel::expression::ValidGrouping<__GroupByClause>,
<T as
diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate: diesel::expression::MixedAggregates<<U
as
diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate>
{
type IsAggregate =
<<T as
diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate
as
diesel::expression::MixedAggregates<<U as
diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate>>::Output;
}
};
impl<T, U> GtEq<T, U> {
#[allow(dead_code)]
pub(crate) fn new(left: T, right: U) -> Self { GtEq { left, right } }
}
impl<T, U, QS> crate::expression::SelectableExpression<QS> for GtEq<T, U>
where GtEq<T, U>: crate::expression::AppearsOnTable<QS>,
T: crate::expression::SelectableExpression<QS>,
U: crate::expression::SelectableExpression<QS> {}
impl<T, U, QS> crate::expression::AppearsOnTable<QS> for GtEq<T, U> where
GtEq<T, U>: crate::expression::Expression,
T: crate::expression::AppearsOnTable<QS>,
U: crate::expression::AppearsOnTable<QS> {}
impl<T, U> crate::expression::Expression for GtEq<T, U> where
T: crate::expression::Expression, U: crate::expression::Expression,
<T as crate::expression::Expression>::SqlType: crate::sql_types::SqlType,
<U as crate::expression::Expression>::SqlType: crate::sql_types::SqlType,
crate::sql_types::is_nullable::IsSqlTypeNullable<<T as
crate::expression::Expression>::SqlType>: crate::sql_types::OneIsNullable<crate::sql_types::is_nullable::IsSqlTypeNullable<<U
as crate::expression::Expression>::SqlType>>,
crate::sql_types::is_nullable::IsOneNullable<<T as
crate::expression::Expression>::SqlType,
<U as
crate::expression::Expression>::SqlType>: crate::sql_types::MaybeNullableType<crate::sql_types::Bool>
{
type SqlType =
crate::sql_types::is_nullable::MaybeNullable<crate::sql_types::is_nullable::IsOneNullable<<T
as crate::expression::Expression>::SqlType,
<U as crate::expression::Expression>::SqlType>,
crate::sql_types::Bool>;
}
impl<T, U, DB> crate::query_builder::QueryFragment<DB> for GtEq<T, U> where
T: crate::query_builder::QueryFragment<DB>,
U: crate::query_builder::QueryFragment<DB>, DB: crate::backend::Backend {
fn walk_ast<'b>(&'b self,
mut out: crate::query_builder::AstPass<'_, 'b, DB>)
-> crate::result::QueryResult<()> {
self.left.walk_ast(out.reborrow())?;
out.push_sql(" >= ");
self.right.walk_ast(out.reborrow())?;
;
Ok(())
}
}
impl<S, T, U> crate::internal::operators_macro::FieldAliasMapper<S> for
GtEq<T, U> where S: crate::query_source::AliasSource,
T: crate::internal::operators_macro::FieldAliasMapper<S>,
U: crate::internal::operators_macro::FieldAliasMapper<S> {
type Out =
GtEq<<T as
crate::internal::operators_macro::FieldAliasMapper<S>>::Out,
<U as crate::internal::operators_macro::FieldAliasMapper<S>>::Out>;
fn map(self, alias: &crate::query_source::Alias<S>) -> Self::Out {
GtEq { left: self.left.map(alias), right: self.right.map(alias) }
}
}infix_operator!(GtEq, " >= ");
619#[doc(hidden)]
#[allow(unreachable_pub)]
pub struct Lt<T, U> {
pub(crate) left: T,
pub(crate) right: U,
}
#[automatically_derived]
#[allow(unreachable_pub)]
impl<T: ::core::fmt::Debug, U: ::core::fmt::Debug> ::core::fmt::Debug for
Lt<T, U> {
#[inline]
fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
::core::fmt::Formatter::debug_struct_field2_finish(f, "Lt", "left",
&self.left, "right", &&self.right)
}
}
#[automatically_derived]
#[allow(unreachable_pub)]
impl<T: ::core::clone::Clone, U: ::core::clone::Clone> ::core::clone::Clone
for Lt<T, U> {
#[inline]
fn clone(&self) -> Lt<T, U> {
Lt {
left: ::core::clone::Clone::clone(&self.left),
right: ::core::clone::Clone::clone(&self.right),
}
}
}
#[automatically_derived]
#[allow(unreachable_pub)]
impl<T: ::core::marker::Copy, U: ::core::marker::Copy> ::core::marker::Copy
for Lt<T, U> {
}
const _: () =
{
use diesel;
#[allow(non_camel_case_types)]
impl<T: diesel::query_builder::QueryId,
U: diesel::query_builder::QueryId> diesel::query_builder::QueryId
for Lt<T, U> {
type QueryId =
Lt<<T as diesel::query_builder::QueryId>::QueryId,
<U as diesel::query_builder::QueryId>::QueryId>;
const HAS_STATIC_QUERY_ID: bool =
<T as diesel::query_builder::QueryId>::HAS_STATIC_QUERY_ID &&
<U as diesel::query_builder::QueryId>::HAS_STATIC_QUERY_ID
&& true;
const IS_WINDOW_FUNCTION: bool =
<T as diesel::query_builder::QueryId>::IS_WINDOW_FUNCTION ||
<U as diesel::query_builder::QueryId>::IS_WINDOW_FUNCTION ||
false;
}
};
const _: () =
{
use diesel;
use diesel::internal::derives::numeric_ops as ops;
use diesel::expression::{Expression, AsExpression};
use diesel::sql_types::ops::{Add, Sub, Mul, Div};
use diesel::sql_types::{SqlType, SingleValue};
impl<T, U, __Rhs> ::core::ops::Add<__Rhs> for Lt<T, U> where
Self: Expression, Self: Expression,
<Self as Expression>::SqlType: Add,
<<Self as Expression>::SqlType as Add>::Rhs: SqlType +
SingleValue,
__Rhs: AsExpression<<<Self as Expression>::SqlType as Add>::Rhs> {
type Output = ops::Add<Self, __Rhs::Expression>;
fn add(self, rhs: __Rhs) -> Self::Output {
ops::Add::new(self, rhs.as_expression())
}
}
impl<T, U, __Rhs> ::core::ops::Sub<__Rhs> for Lt<T, U> where
Self: Expression, Self: Expression,
<Self as Expression>::SqlType: Sub,
<<Self as Expression>::SqlType as Sub>::Rhs: SqlType +
SingleValue,
__Rhs: AsExpression<<<Self as Expression>::SqlType as Sub>::Rhs> {
type Output = ops::Sub<Self, __Rhs::Expression>;
fn sub(self, rhs: __Rhs) -> Self::Output {
ops::Sub::new(self, rhs.as_expression())
}
}
impl<T, U, __Rhs> ::core::ops::Mul<__Rhs> for Lt<T, U> where
Self: Expression, Self: Expression,
<Self as Expression>::SqlType: Mul,
<<Self as Expression>::SqlType as Mul>::Rhs: SqlType +
SingleValue,
__Rhs: AsExpression<<<Self as Expression>::SqlType as Mul>::Rhs> {
type Output = ops::Mul<Self, __Rhs::Expression>;
fn mul(self, rhs: __Rhs) -> Self::Output {
ops::Mul::new(self, rhs.as_expression())
}
}
impl<T, U, __Rhs> ::core::ops::Div<__Rhs> for Lt<T, U> where
Self: Expression, Self: Expression,
<Self as Expression>::SqlType: Div,
<<Self as Expression>::SqlType as Div>::Rhs: SqlType +
SingleValue,
__Rhs: AsExpression<<<Self as Expression>::SqlType as Div>::Rhs> {
type Output = ops::Div<Self, __Rhs::Expression>;
fn div(self, rhs: __Rhs) -> Self::Output {
ops::Div::new(self, rhs.as_expression())
}
}
};
const _: () =
{
use diesel;
impl<T, U, __GroupByClause>
diesel::expression::ValidGrouping<__GroupByClause> for Lt<T, U>
where T: diesel::expression::ValidGrouping<__GroupByClause>,
U: diesel::expression::ValidGrouping<__GroupByClause>,
<T as
diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate: diesel::expression::MixedAggregates<<U
as
diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate>
{
type IsAggregate =
<<T as
diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate
as
diesel::expression::MixedAggregates<<U as
diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate>>::Output;
}
};
impl<T, U> Lt<T, U> {
#[allow(dead_code)]
pub(crate) fn new(left: T, right: U) -> Self { Lt { left, right } }
}
impl<T, U, QS> crate::expression::SelectableExpression<QS> for Lt<T, U> where
Lt<T, U>: crate::expression::AppearsOnTable<QS>,
T: crate::expression::SelectableExpression<QS>,
U: crate::expression::SelectableExpression<QS> {}
impl<T, U, QS> crate::expression::AppearsOnTable<QS> for Lt<T, U> where
Lt<T, U>: crate::expression::Expression,
T: crate::expression::AppearsOnTable<QS>,
U: crate::expression::AppearsOnTable<QS> {}
impl<T, U> crate::expression::Expression for Lt<T, U> where
T: crate::expression::Expression, U: crate::expression::Expression,
<T as crate::expression::Expression>::SqlType: crate::sql_types::SqlType,
<U as crate::expression::Expression>::SqlType: crate::sql_types::SqlType,
crate::sql_types::is_nullable::IsSqlTypeNullable<<T as
crate::expression::Expression>::SqlType>: crate::sql_types::OneIsNullable<crate::sql_types::is_nullable::IsSqlTypeNullable<<U
as crate::expression::Expression>::SqlType>>,
crate::sql_types::is_nullable::IsOneNullable<<T as
crate::expression::Expression>::SqlType,
<U as
crate::expression::Expression>::SqlType>: crate::sql_types::MaybeNullableType<crate::sql_types::Bool>
{
type SqlType =
crate::sql_types::is_nullable::MaybeNullable<crate::sql_types::is_nullable::IsOneNullable<<T
as crate::expression::Expression>::SqlType,
<U as crate::expression::Expression>::SqlType>,
crate::sql_types::Bool>;
}
impl<T, U, DB> crate::query_builder::QueryFragment<DB> for Lt<T, U> where
T: crate::query_builder::QueryFragment<DB>,
U: crate::query_builder::QueryFragment<DB>, DB: crate::backend::Backend {
fn walk_ast<'b>(&'b self,
mut out: crate::query_builder::AstPass<'_, 'b, DB>)
-> crate::result::QueryResult<()> {
self.left.walk_ast(out.reborrow())?;
out.push_sql(" < ");
self.right.walk_ast(out.reborrow())?;
;
Ok(())
}
}
impl<S, T, U> crate::internal::operators_macro::FieldAliasMapper<S> for
Lt<T, U> where S: crate::query_source::AliasSource,
T: crate::internal::operators_macro::FieldAliasMapper<S>,
U: crate::internal::operators_macro::FieldAliasMapper<S> {
type Out =
Lt<<T as crate::internal::operators_macro::FieldAliasMapper<S>>::Out,
<U as crate::internal::operators_macro::FieldAliasMapper<S>>::Out>;
fn map(self, alias: &crate::query_source::Alias<S>) -> Self::Out {
Lt { left: self.left.map(alias), right: self.right.map(alias) }
}
}infix_operator!(Lt, " < ");
620#[doc(hidden)]
#[allow(unreachable_pub)]
pub struct LtEq<T, U> {
pub(crate) left: T,
pub(crate) right: U,
}
#[automatically_derived]
#[allow(unreachable_pub)]
impl<T: ::core::fmt::Debug, U: ::core::fmt::Debug> ::core::fmt::Debug for
LtEq<T, U> {
#[inline]
fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
::core::fmt::Formatter::debug_struct_field2_finish(f, "LtEq", "left",
&self.left, "right", &&self.right)
}
}
#[automatically_derived]
#[allow(unreachable_pub)]
impl<T: ::core::clone::Clone, U: ::core::clone::Clone> ::core::clone::Clone
for LtEq<T, U> {
#[inline]
fn clone(&self) -> LtEq<T, U> {
LtEq {
left: ::core::clone::Clone::clone(&self.left),
right: ::core::clone::Clone::clone(&self.right),
}
}
}
#[automatically_derived]
#[allow(unreachable_pub)]
impl<T: ::core::marker::Copy, U: ::core::marker::Copy> ::core::marker::Copy
for LtEq<T, U> {
}
const _: () =
{
use diesel;
#[allow(non_camel_case_types)]
impl<T: diesel::query_builder::QueryId,
U: diesel::query_builder::QueryId> diesel::query_builder::QueryId
for LtEq<T, U> {
type QueryId =
LtEq<<T as diesel::query_builder::QueryId>::QueryId,
<U as diesel::query_builder::QueryId>::QueryId>;
const HAS_STATIC_QUERY_ID: bool =
<T as diesel::query_builder::QueryId>::HAS_STATIC_QUERY_ID &&
<U as diesel::query_builder::QueryId>::HAS_STATIC_QUERY_ID
&& true;
const IS_WINDOW_FUNCTION: bool =
<T as diesel::query_builder::QueryId>::IS_WINDOW_FUNCTION ||
<U as diesel::query_builder::QueryId>::IS_WINDOW_FUNCTION ||
false;
}
};
const _: () =
{
use diesel;
use diesel::internal::derives::numeric_ops as ops;
use diesel::expression::{Expression, AsExpression};
use diesel::sql_types::ops::{Add, Sub, Mul, Div};
use diesel::sql_types::{SqlType, SingleValue};
impl<T, U, __Rhs> ::core::ops::Add<__Rhs> for LtEq<T, U> where
Self: Expression, Self: Expression,
<Self as Expression>::SqlType: Add,
<<Self as Expression>::SqlType as Add>::Rhs: SqlType +
SingleValue,
__Rhs: AsExpression<<<Self as Expression>::SqlType as Add>::Rhs> {
type Output = ops::Add<Self, __Rhs::Expression>;
fn add(self, rhs: __Rhs) -> Self::Output {
ops::Add::new(self, rhs.as_expression())
}
}
impl<T, U, __Rhs> ::core::ops::Sub<__Rhs> for LtEq<T, U> where
Self: Expression, Self: Expression,
<Self as Expression>::SqlType: Sub,
<<Self as Expression>::SqlType as Sub>::Rhs: SqlType +
SingleValue,
__Rhs: AsExpression<<<Self as Expression>::SqlType as Sub>::Rhs> {
type Output = ops::Sub<Self, __Rhs::Expression>;
fn sub(self, rhs: __Rhs) -> Self::Output {
ops::Sub::new(self, rhs.as_expression())
}
}
impl<T, U, __Rhs> ::core::ops::Mul<__Rhs> for LtEq<T, U> where
Self: Expression, Self: Expression,
<Self as Expression>::SqlType: Mul,
<<Self as Expression>::SqlType as Mul>::Rhs: SqlType +
SingleValue,
__Rhs: AsExpression<<<Self as Expression>::SqlType as Mul>::Rhs> {
type Output = ops::Mul<Self, __Rhs::Expression>;
fn mul(self, rhs: __Rhs) -> Self::Output {
ops::Mul::new(self, rhs.as_expression())
}
}
impl<T, U, __Rhs> ::core::ops::Div<__Rhs> for LtEq<T, U> where
Self: Expression, Self: Expression,
<Self as Expression>::SqlType: Div,
<<Self as Expression>::SqlType as Div>::Rhs: SqlType +
SingleValue,
__Rhs: AsExpression<<<Self as Expression>::SqlType as Div>::Rhs> {
type Output = ops::Div<Self, __Rhs::Expression>;
fn div(self, rhs: __Rhs) -> Self::Output {
ops::Div::new(self, rhs.as_expression())
}
}
};
const _: () =
{
use diesel;
impl<T, U, __GroupByClause>
diesel::expression::ValidGrouping<__GroupByClause> for LtEq<T, U>
where T: diesel::expression::ValidGrouping<__GroupByClause>,
U: diesel::expression::ValidGrouping<__GroupByClause>,
<T as
diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate: diesel::expression::MixedAggregates<<U
as
diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate>
{
type IsAggregate =
<<T as
diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate
as
diesel::expression::MixedAggregates<<U as
diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate>>::Output;
}
};
impl<T, U> LtEq<T, U> {
#[allow(dead_code)]
pub(crate) fn new(left: T, right: U) -> Self { LtEq { left, right } }
}
impl<T, U, QS> crate::expression::SelectableExpression<QS> for LtEq<T, U>
where LtEq<T, U>: crate::expression::AppearsOnTable<QS>,
T: crate::expression::SelectableExpression<QS>,
U: crate::expression::SelectableExpression<QS> {}
impl<T, U, QS> crate::expression::AppearsOnTable<QS> for LtEq<T, U> where
LtEq<T, U>: crate::expression::Expression,
T: crate::expression::AppearsOnTable<QS>,
U: crate::expression::AppearsOnTable<QS> {}
impl<T, U> crate::expression::Expression for LtEq<T, U> where
T: crate::expression::Expression, U: crate::expression::Expression,
<T as crate::expression::Expression>::SqlType: crate::sql_types::SqlType,
<U as crate::expression::Expression>::SqlType: crate::sql_types::SqlType,
crate::sql_types::is_nullable::IsSqlTypeNullable<<T as
crate::expression::Expression>::SqlType>: crate::sql_types::OneIsNullable<crate::sql_types::is_nullable::IsSqlTypeNullable<<U
as crate::expression::Expression>::SqlType>>,
crate::sql_types::is_nullable::IsOneNullable<<T as
crate::expression::Expression>::SqlType,
<U as
crate::expression::Expression>::SqlType>: crate::sql_types::MaybeNullableType<crate::sql_types::Bool>
{
type SqlType =
crate::sql_types::is_nullable::MaybeNullable<crate::sql_types::is_nullable::IsOneNullable<<T
as crate::expression::Expression>::SqlType,
<U as crate::expression::Expression>::SqlType>,
crate::sql_types::Bool>;
}
impl<T, U, DB> crate::query_builder::QueryFragment<DB> for LtEq<T, U> where
T: crate::query_builder::QueryFragment<DB>,
U: crate::query_builder::QueryFragment<DB>, DB: crate::backend::Backend {
fn walk_ast<'b>(&'b self,
mut out: crate::query_builder::AstPass<'_, 'b, DB>)
-> crate::result::QueryResult<()> {
self.left.walk_ast(out.reborrow())?;
out.push_sql(" <= ");
self.right.walk_ast(out.reborrow())?;
;
Ok(())
}
}
impl<S, T, U> crate::internal::operators_macro::FieldAliasMapper<S> for
LtEq<T, U> where S: crate::query_source::AliasSource,
T: crate::internal::operators_macro::FieldAliasMapper<S>,
U: crate::internal::operators_macro::FieldAliasMapper<S> {
type Out =
LtEq<<T as
crate::internal::operators_macro::FieldAliasMapper<S>>::Out,
<U as crate::internal::operators_macro::FieldAliasMapper<S>>::Out>;
fn map(self, alias: &crate::query_source::Alias<S>) -> Self::Out {
LtEq { left: self.left.map(alias), right: self.right.map(alias) }
}
}infix_operator!(LtEq, " <= ");
621#[doc(hidden)]
#[allow(unreachable_pub)]
pub struct NotEq<T, U> {
pub(crate) left: T,
pub(crate) right: U,
}
#[automatically_derived]
#[allow(unreachable_pub)]
impl<T: ::core::fmt::Debug, U: ::core::fmt::Debug> ::core::fmt::Debug for
NotEq<T, U> {
#[inline]
fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
::core::fmt::Formatter::debug_struct_field2_finish(f, "NotEq", "left",
&self.left, "right", &&self.right)
}
}
#[automatically_derived]
#[allow(unreachable_pub)]
impl<T: ::core::clone::Clone, U: ::core::clone::Clone> ::core::clone::Clone
for NotEq<T, U> {
#[inline]
fn clone(&self) -> NotEq<T, U> {
NotEq {
left: ::core::clone::Clone::clone(&self.left),
right: ::core::clone::Clone::clone(&self.right),
}
}
}
#[automatically_derived]
#[allow(unreachable_pub)]
impl<T: ::core::marker::Copy, U: ::core::marker::Copy> ::core::marker::Copy
for NotEq<T, U> {
}
const _: () =
{
use diesel;
#[allow(non_camel_case_types)]
impl<T: diesel::query_builder::QueryId,
U: diesel::query_builder::QueryId> diesel::query_builder::QueryId
for NotEq<T, U> {
type QueryId =
NotEq<<T as diesel::query_builder::QueryId>::QueryId,
<U as diesel::query_builder::QueryId>::QueryId>;
const HAS_STATIC_QUERY_ID: bool =
<T as diesel::query_builder::QueryId>::HAS_STATIC_QUERY_ID &&
<U as diesel::query_builder::QueryId>::HAS_STATIC_QUERY_ID
&& true;
const IS_WINDOW_FUNCTION: bool =
<T as diesel::query_builder::QueryId>::IS_WINDOW_FUNCTION ||
<U as diesel::query_builder::QueryId>::IS_WINDOW_FUNCTION ||
false;
}
};
const _: () =
{
use diesel;
use diesel::internal::derives::numeric_ops as ops;
use diesel::expression::{Expression, AsExpression};
use diesel::sql_types::ops::{Add, Sub, Mul, Div};
use diesel::sql_types::{SqlType, SingleValue};
impl<T, U, __Rhs> ::core::ops::Add<__Rhs> for NotEq<T, U> where
Self: Expression, Self: Expression,
<Self as Expression>::SqlType: Add,
<<Self as Expression>::SqlType as Add>::Rhs: SqlType +
SingleValue,
__Rhs: AsExpression<<<Self as Expression>::SqlType as Add>::Rhs> {
type Output = ops::Add<Self, __Rhs::Expression>;
fn add(self, rhs: __Rhs) -> Self::Output {
ops::Add::new(self, rhs.as_expression())
}
}
impl<T, U, __Rhs> ::core::ops::Sub<__Rhs> for NotEq<T, U> where
Self: Expression, Self: Expression,
<Self as Expression>::SqlType: Sub,
<<Self as Expression>::SqlType as Sub>::Rhs: SqlType +
SingleValue,
__Rhs: AsExpression<<<Self as Expression>::SqlType as Sub>::Rhs> {
type Output = ops::Sub<Self, __Rhs::Expression>;
fn sub(self, rhs: __Rhs) -> Self::Output {
ops::Sub::new(self, rhs.as_expression())
}
}
impl<T, U, __Rhs> ::core::ops::Mul<__Rhs> for NotEq<T, U> where
Self: Expression, Self: Expression,
<Self as Expression>::SqlType: Mul,
<<Self as Expression>::SqlType as Mul>::Rhs: SqlType +
SingleValue,
__Rhs: AsExpression<<<Self as Expression>::SqlType as Mul>::Rhs> {
type Output = ops::Mul<Self, __Rhs::Expression>;
fn mul(self, rhs: __Rhs) -> Self::Output {
ops::Mul::new(self, rhs.as_expression())
}
}
impl<T, U, __Rhs> ::core::ops::Div<__Rhs> for NotEq<T, U> where
Self: Expression, Self: Expression,
<Self as Expression>::SqlType: Div,
<<Self as Expression>::SqlType as Div>::Rhs: SqlType +
SingleValue,
__Rhs: AsExpression<<<Self as Expression>::SqlType as Div>::Rhs> {
type Output = ops::Div<Self, __Rhs::Expression>;
fn div(self, rhs: __Rhs) -> Self::Output {
ops::Div::new(self, rhs.as_expression())
}
}
};
const _: () =
{
use diesel;
impl<T, U, __GroupByClause>
diesel::expression::ValidGrouping<__GroupByClause> for NotEq<T, U>
where T: diesel::expression::ValidGrouping<__GroupByClause>,
U: diesel::expression::ValidGrouping<__GroupByClause>,
<T as
diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate: diesel::expression::MixedAggregates<<U
as
diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate>
{
type IsAggregate =
<<T as
diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate
as
diesel::expression::MixedAggregates<<U as
diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate>>::Output;
}
};
impl<T, U> NotEq<T, U> {
#[allow(dead_code)]
pub(crate) fn new(left: T, right: U) -> Self { NotEq { left, right } }
}
impl<T, U, QS> crate::expression::SelectableExpression<QS> for NotEq<T, U>
where NotEq<T, U>: crate::expression::AppearsOnTable<QS>,
T: crate::expression::SelectableExpression<QS>,
U: crate::expression::SelectableExpression<QS> {}
impl<T, U, QS> crate::expression::AppearsOnTable<QS> for NotEq<T, U> where
NotEq<T, U>: crate::expression::Expression,
T: crate::expression::AppearsOnTable<QS>,
U: crate::expression::AppearsOnTable<QS> {}
impl<T, U> crate::expression::Expression for NotEq<T, U> where
T: crate::expression::Expression, U: crate::expression::Expression,
<T as crate::expression::Expression>::SqlType: crate::sql_types::SqlType,
<U as crate::expression::Expression>::SqlType: crate::sql_types::SqlType,
crate::sql_types::is_nullable::IsSqlTypeNullable<<T as
crate::expression::Expression>::SqlType>: crate::sql_types::OneIsNullable<crate::sql_types::is_nullable::IsSqlTypeNullable<<U
as crate::expression::Expression>::SqlType>>,
crate::sql_types::is_nullable::IsOneNullable<<T as
crate::expression::Expression>::SqlType,
<U as
crate::expression::Expression>::SqlType>: crate::sql_types::MaybeNullableType<crate::sql_types::Bool>
{
type SqlType =
crate::sql_types::is_nullable::MaybeNullable<crate::sql_types::is_nullable::IsOneNullable<<T
as crate::expression::Expression>::SqlType,
<U as crate::expression::Expression>::SqlType>,
crate::sql_types::Bool>;
}
impl<T, U, DB> crate::query_builder::QueryFragment<DB> for NotEq<T, U> where
T: crate::query_builder::QueryFragment<DB>,
U: crate::query_builder::QueryFragment<DB>, DB: crate::backend::Backend {
fn walk_ast<'b>(&'b self,
mut out: crate::query_builder::AstPass<'_, 'b, DB>)
-> crate::result::QueryResult<()> {
self.left.walk_ast(out.reborrow())?;
out.push_sql(" != ");
self.right.walk_ast(out.reborrow())?;
;
Ok(())
}
}
impl<S, T, U> crate::internal::operators_macro::FieldAliasMapper<S> for
NotEq<T, U> where S: crate::query_source::AliasSource,
T: crate::internal::operators_macro::FieldAliasMapper<S>,
U: crate::internal::operators_macro::FieldAliasMapper<S> {
type Out =
NotEq<<T as
crate::internal::operators_macro::FieldAliasMapper<S>>::Out,
<U as crate::internal::operators_macro::FieldAliasMapper<S>>::Out>;
fn map(self, alias: &crate::query_source::Alias<S>) -> Self::Out {
NotEq { left: self.left.map(alias), right: self.right.map(alias) }
}
}infix_operator!(NotEq, " != ");
622#[doc(hidden)]
#[allow(unreachable_pub)]
pub struct NotLike<T, U> {
pub(crate) left: T,
pub(crate) right: U,
}
#[automatically_derived]
#[allow(unreachable_pub)]
impl<T: ::core::fmt::Debug, U: ::core::fmt::Debug> ::core::fmt::Debug for
NotLike<T, U> {
#[inline]
fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
::core::fmt::Formatter::debug_struct_field2_finish(f, "NotLike",
"left", &self.left, "right", &&self.right)
}
}
#[automatically_derived]
#[allow(unreachable_pub)]
impl<T: ::core::clone::Clone, U: ::core::clone::Clone> ::core::clone::Clone
for NotLike<T, U> {
#[inline]
fn clone(&self) -> NotLike<T, U> {
NotLike {
left: ::core::clone::Clone::clone(&self.left),
right: ::core::clone::Clone::clone(&self.right),
}
}
}
#[automatically_derived]
#[allow(unreachable_pub)]
impl<T: ::core::marker::Copy, U: ::core::marker::Copy> ::core::marker::Copy
for NotLike<T, U> {
}
const _: () =
{
use diesel;
#[allow(non_camel_case_types)]
impl<T: diesel::query_builder::QueryId,
U: diesel::query_builder::QueryId> diesel::query_builder::QueryId
for NotLike<T, U> {
type QueryId =
NotLike<<T as diesel::query_builder::QueryId>::QueryId,
<U as diesel::query_builder::QueryId>::QueryId>;
const HAS_STATIC_QUERY_ID: bool =
<T as diesel::query_builder::QueryId>::HAS_STATIC_QUERY_ID &&
<U as diesel::query_builder::QueryId>::HAS_STATIC_QUERY_ID
&& true;
const IS_WINDOW_FUNCTION: bool =
<T as diesel::query_builder::QueryId>::IS_WINDOW_FUNCTION ||
<U as diesel::query_builder::QueryId>::IS_WINDOW_FUNCTION ||
false;
}
};
const _: () =
{
use diesel;
use diesel::internal::derives::numeric_ops as ops;
use diesel::expression::{Expression, AsExpression};
use diesel::sql_types::ops::{Add, Sub, Mul, Div};
use diesel::sql_types::{SqlType, SingleValue};
impl<T, U, __Rhs> ::core::ops::Add<__Rhs> for NotLike<T, U> where
Self: Expression, Self: Expression,
<Self as Expression>::SqlType: Add,
<<Self as Expression>::SqlType as Add>::Rhs: SqlType +
SingleValue,
__Rhs: AsExpression<<<Self as Expression>::SqlType as Add>::Rhs> {
type Output = ops::Add<Self, __Rhs::Expression>;
fn add(self, rhs: __Rhs) -> Self::Output {
ops::Add::new(self, rhs.as_expression())
}
}
impl<T, U, __Rhs> ::core::ops::Sub<__Rhs> for NotLike<T, U> where
Self: Expression, Self: Expression,
<Self as Expression>::SqlType: Sub,
<<Self as Expression>::SqlType as Sub>::Rhs: SqlType +
SingleValue,
__Rhs: AsExpression<<<Self as Expression>::SqlType as Sub>::Rhs> {
type Output = ops::Sub<Self, __Rhs::Expression>;
fn sub(self, rhs: __Rhs) -> Self::Output {
ops::Sub::new(self, rhs.as_expression())
}
}
impl<T, U, __Rhs> ::core::ops::Mul<__Rhs> for NotLike<T, U> where
Self: Expression, Self: Expression,
<Self as Expression>::SqlType: Mul,
<<Self as Expression>::SqlType as Mul>::Rhs: SqlType +
SingleValue,
__Rhs: AsExpression<<<Self as Expression>::SqlType as Mul>::Rhs> {
type Output = ops::Mul<Self, __Rhs::Expression>;
fn mul(self, rhs: __Rhs) -> Self::Output {
ops::Mul::new(self, rhs.as_expression())
}
}
impl<T, U, __Rhs> ::core::ops::Div<__Rhs> for NotLike<T, U> where
Self: Expression, Self: Expression,
<Self as Expression>::SqlType: Div,
<<Self as Expression>::SqlType as Div>::Rhs: SqlType +
SingleValue,
__Rhs: AsExpression<<<Self as Expression>::SqlType as Div>::Rhs> {
type Output = ops::Div<Self, __Rhs::Expression>;
fn div(self, rhs: __Rhs) -> Self::Output {
ops::Div::new(self, rhs.as_expression())
}
}
};
const _: () =
{
use diesel;
impl<T, U, __GroupByClause>
diesel::expression::ValidGrouping<__GroupByClause> for
NotLike<T, U> where
T: diesel::expression::ValidGrouping<__GroupByClause>,
U: diesel::expression::ValidGrouping<__GroupByClause>,
<T as
diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate: diesel::expression::MixedAggregates<<U
as
diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate>
{
type IsAggregate =
<<T as
diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate
as
diesel::expression::MixedAggregates<<U as
diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate>>::Output;
}
};
impl<T, U> NotLike<T, U> {
#[allow(dead_code)]
pub(crate) fn new(left: T, right: U) -> Self { NotLike { left, right } }
}
impl<T, U, QS> crate::expression::SelectableExpression<QS> for NotLike<T, U>
where NotLike<T, U>: crate::expression::AppearsOnTable<QS>,
T: crate::expression::SelectableExpression<QS>,
U: crate::expression::SelectableExpression<QS> {}
impl<T, U, QS> crate::expression::AppearsOnTable<QS> for NotLike<T, U> where
NotLike<T, U>: crate::expression::Expression,
T: crate::expression::AppearsOnTable<QS>,
U: crate::expression::AppearsOnTable<QS> {}
impl<T, U> crate::expression::Expression for NotLike<T, U> where
T: crate::expression::Expression, U: crate::expression::Expression,
<T as crate::expression::Expression>::SqlType: crate::sql_types::SqlType,
<U as crate::expression::Expression>::SqlType: crate::sql_types::SqlType,
crate::sql_types::is_nullable::IsSqlTypeNullable<<T as
crate::expression::Expression>::SqlType>: crate::sql_types::OneIsNullable<crate::sql_types::is_nullable::IsSqlTypeNullable<<U
as crate::expression::Expression>::SqlType>>,
crate::sql_types::is_nullable::IsOneNullable<<T as
crate::expression::Expression>::SqlType,
<U as
crate::expression::Expression>::SqlType>: crate::sql_types::MaybeNullableType<crate::sql_types::Bool>
{
type SqlType =
crate::sql_types::is_nullable::MaybeNullable<crate::sql_types::is_nullable::IsOneNullable<<T
as crate::expression::Expression>::SqlType,
<U as crate::expression::Expression>::SqlType>,
crate::sql_types::Bool>;
}
impl<T, U, DB> crate::query_builder::QueryFragment<DB> for NotLike<T, U> where
T: crate::query_builder::QueryFragment<DB>,
U: crate::query_builder::QueryFragment<DB>, DB: crate::backend::Backend {
fn walk_ast<'b>(&'b self,
mut out: crate::query_builder::AstPass<'_, 'b, DB>)
-> crate::result::QueryResult<()> {
self.left.walk_ast(out.reborrow())?;
out.push_sql(" NOT LIKE ");
self.right.walk_ast(out.reborrow())?;
;
Ok(())
}
}
impl<S, T, U> crate::internal::operators_macro::FieldAliasMapper<S> for
NotLike<T, U> where S: crate::query_source::AliasSource,
T: crate::internal::operators_macro::FieldAliasMapper<S>,
U: crate::internal::operators_macro::FieldAliasMapper<S> {
type Out =
NotLike<<T as
crate::internal::operators_macro::FieldAliasMapper<S>>::Out,
<U as crate::internal::operators_macro::FieldAliasMapper<S>>::Out>;
fn map(self, alias: &crate::query_source::Alias<S>) -> Self::Out {
NotLike { left: self.left.map(alias), right: self.right.map(alias) }
}
}infix_operator!(NotLike, " NOT LIKE ");
623#[doc(hidden)]
#[allow(unreachable_pub)]
pub struct Between<T, U> {
pub(crate) left: T,
pub(crate) right: U,
}
#[automatically_derived]
#[allow(unreachable_pub)]
impl<T: ::core::fmt::Debug, U: ::core::fmt::Debug> ::core::fmt::Debug for
Between<T, U> {
#[inline]
fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
::core::fmt::Formatter::debug_struct_field2_finish(f, "Between",
"left", &self.left, "right", &&self.right)
}
}
#[automatically_derived]
#[allow(unreachable_pub)]
impl<T: ::core::clone::Clone, U: ::core::clone::Clone> ::core::clone::Clone
for Between<T, U> {
#[inline]
fn clone(&self) -> Between<T, U> {
Between {
left: ::core::clone::Clone::clone(&self.left),
right: ::core::clone::Clone::clone(&self.right),
}
}
}
#[automatically_derived]
#[allow(unreachable_pub)]
impl<T: ::core::marker::Copy, U: ::core::marker::Copy> ::core::marker::Copy
for Between<T, U> {
}
const _: () =
{
use diesel;
#[allow(non_camel_case_types)]
impl<T: diesel::query_builder::QueryId,
U: diesel::query_builder::QueryId> diesel::query_builder::QueryId
for Between<T, U> {
type QueryId =
Between<<T as diesel::query_builder::QueryId>::QueryId,
<U as diesel::query_builder::QueryId>::QueryId>;
const HAS_STATIC_QUERY_ID: bool =
<T as diesel::query_builder::QueryId>::HAS_STATIC_QUERY_ID &&
<U as diesel::query_builder::QueryId>::HAS_STATIC_QUERY_ID
&& true;
const IS_WINDOW_FUNCTION: bool =
<T as diesel::query_builder::QueryId>::IS_WINDOW_FUNCTION ||
<U as diesel::query_builder::QueryId>::IS_WINDOW_FUNCTION ||
false;
}
};
const _: () =
{
use diesel;
use diesel::internal::derives::numeric_ops as ops;
use diesel::expression::{Expression, AsExpression};
use diesel::sql_types::ops::{Add, Sub, Mul, Div};
use diesel::sql_types::{SqlType, SingleValue};
impl<T, U, __Rhs> ::core::ops::Add<__Rhs> for Between<T, U> where
Self: Expression, Self: Expression,
<Self as Expression>::SqlType: Add,
<<Self as Expression>::SqlType as Add>::Rhs: SqlType +
SingleValue,
__Rhs: AsExpression<<<Self as Expression>::SqlType as Add>::Rhs> {
type Output = ops::Add<Self, __Rhs::Expression>;
fn add(self, rhs: __Rhs) -> Self::Output {
ops::Add::new(self, rhs.as_expression())
}
}
impl<T, U, __Rhs> ::core::ops::Sub<__Rhs> for Between<T, U> where
Self: Expression, Self: Expression,
<Self as Expression>::SqlType: Sub,
<<Self as Expression>::SqlType as Sub>::Rhs: SqlType +
SingleValue,
__Rhs: AsExpression<<<Self as Expression>::SqlType as Sub>::Rhs> {
type Output = ops::Sub<Self, __Rhs::Expression>;
fn sub(self, rhs: __Rhs) -> Self::Output {
ops::Sub::new(self, rhs.as_expression())
}
}
impl<T, U, __Rhs> ::core::ops::Mul<__Rhs> for Between<T, U> where
Self: Expression, Self: Expression,
<Self as Expression>::SqlType: Mul,
<<Self as Expression>::SqlType as Mul>::Rhs: SqlType +
SingleValue,
__Rhs: AsExpression<<<Self as Expression>::SqlType as Mul>::Rhs> {
type Output = ops::Mul<Self, __Rhs::Expression>;
fn mul(self, rhs: __Rhs) -> Self::Output {
ops::Mul::new(self, rhs.as_expression())
}
}
impl<T, U, __Rhs> ::core::ops::Div<__Rhs> for Between<T, U> where
Self: Expression, Self: Expression,
<Self as Expression>::SqlType: Div,
<<Self as Expression>::SqlType as Div>::Rhs: SqlType +
SingleValue,
__Rhs: AsExpression<<<Self as Expression>::SqlType as Div>::Rhs> {
type Output = ops::Div<Self, __Rhs::Expression>;
fn div(self, rhs: __Rhs) -> Self::Output {
ops::Div::new(self, rhs.as_expression())
}
}
};
const _: () =
{
use diesel;
impl<T, U, __GroupByClause>
diesel::expression::ValidGrouping<__GroupByClause> for
Between<T, U> where
T: diesel::expression::ValidGrouping<__GroupByClause>,
U: diesel::expression::ValidGrouping<__GroupByClause>,
<T as
diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate: diesel::expression::MixedAggregates<<U
as
diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate>
{
type IsAggregate =
<<T as
diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate
as
diesel::expression::MixedAggregates<<U as
diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate>>::Output;
}
};
impl<T, U> Between<T, U> {
#[allow(dead_code)]
pub(crate) fn new(left: T, right: U) -> Self { Between { left, right } }
}
impl<T, U, QS> crate::expression::SelectableExpression<QS> for Between<T, U>
where Between<T, U>: crate::expression::AppearsOnTable<QS>,
T: crate::expression::SelectableExpression<QS>,
U: crate::expression::SelectableExpression<QS> {}
impl<T, U, QS> crate::expression::AppearsOnTable<QS> for Between<T, U> where
Between<T, U>: crate::expression::Expression,
T: crate::expression::AppearsOnTable<QS>,
U: crate::expression::AppearsOnTable<QS> {}
impl<T, U> crate::expression::Expression for Between<T, U> where
T: crate::expression::Expression, U: crate::expression::Expression,
<T as crate::expression::Expression>::SqlType: crate::sql_types::SqlType,
<U as crate::expression::Expression>::SqlType: crate::sql_types::SqlType,
crate::sql_types::is_nullable::IsSqlTypeNullable<<T as
crate::expression::Expression>::SqlType>: crate::sql_types::OneIsNullable<crate::sql_types::is_nullable::IsSqlTypeNullable<<U
as crate::expression::Expression>::SqlType>>,
crate::sql_types::is_nullable::IsOneNullable<<T as
crate::expression::Expression>::SqlType,
<U as
crate::expression::Expression>::SqlType>: crate::sql_types::MaybeNullableType<crate::sql_types::Bool>
{
type SqlType =
crate::sql_types::is_nullable::MaybeNullable<crate::sql_types::is_nullable::IsOneNullable<<T
as crate::expression::Expression>::SqlType,
<U as crate::expression::Expression>::SqlType>,
crate::sql_types::Bool>;
}
impl<T, U, DB> crate::query_builder::QueryFragment<DB> for Between<T, U> where
T: crate::query_builder::QueryFragment<DB>,
U: crate::query_builder::QueryFragment<DB>, DB: crate::backend::Backend {
fn walk_ast<'b>(&'b self,
mut out: crate::query_builder::AstPass<'_, 'b, DB>)
-> crate::result::QueryResult<()> {
self.left.walk_ast(out.reborrow())?;
out.push_sql(" BETWEEN ");
self.right.walk_ast(out.reborrow())?;
;
Ok(())
}
}
impl<S, T, U> crate::internal::operators_macro::FieldAliasMapper<S> for
Between<T, U> where S: crate::query_source::AliasSource,
T: crate::internal::operators_macro::FieldAliasMapper<S>,
U: crate::internal::operators_macro::FieldAliasMapper<S> {
type Out =
Between<<T as
crate::internal::operators_macro::FieldAliasMapper<S>>::Out,
<U as crate::internal::operators_macro::FieldAliasMapper<S>>::Out>;
fn map(self, alias: &crate::query_source::Alias<S>) -> Self::Out {
Between { left: self.left.map(alias), right: self.right.map(alias) }
}
}infix_operator!(Between, " BETWEEN ");
624#[doc(hidden)]
#[allow(unreachable_pub)]
pub struct NotBetween<T, U> {
pub(crate) left: T,
pub(crate) right: U,
}
#[automatically_derived]
#[allow(unreachable_pub)]
impl<T: ::core::fmt::Debug, U: ::core::fmt::Debug> ::core::fmt::Debug for
NotBetween<T, U> {
#[inline]
fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
::core::fmt::Formatter::debug_struct_field2_finish(f, "NotBetween",
"left", &self.left, "right", &&self.right)
}
}
#[automatically_derived]
#[allow(unreachable_pub)]
impl<T: ::core::clone::Clone, U: ::core::clone::Clone> ::core::clone::Clone
for NotBetween<T, U> {
#[inline]
fn clone(&self) -> NotBetween<T, U> {
NotBetween {
left: ::core::clone::Clone::clone(&self.left),
right: ::core::clone::Clone::clone(&self.right),
}
}
}
#[automatically_derived]
#[allow(unreachable_pub)]
impl<T: ::core::marker::Copy, U: ::core::marker::Copy> ::core::marker::Copy
for NotBetween<T, U> {
}
const _: () =
{
use diesel;
#[allow(non_camel_case_types)]
impl<T: diesel::query_builder::QueryId,
U: diesel::query_builder::QueryId> diesel::query_builder::QueryId
for NotBetween<T, U> {
type QueryId =
NotBetween<<T as diesel::query_builder::QueryId>::QueryId,
<U as diesel::query_builder::QueryId>::QueryId>;
const HAS_STATIC_QUERY_ID: bool =
<T as diesel::query_builder::QueryId>::HAS_STATIC_QUERY_ID &&
<U as diesel::query_builder::QueryId>::HAS_STATIC_QUERY_ID
&& true;
const IS_WINDOW_FUNCTION: bool =
<T as diesel::query_builder::QueryId>::IS_WINDOW_FUNCTION ||
<U as diesel::query_builder::QueryId>::IS_WINDOW_FUNCTION ||
false;
}
};
const _: () =
{
use diesel;
use diesel::internal::derives::numeric_ops as ops;
use diesel::expression::{Expression, AsExpression};
use diesel::sql_types::ops::{Add, Sub, Mul, Div};
use diesel::sql_types::{SqlType, SingleValue};
impl<T, U, __Rhs> ::core::ops::Add<__Rhs> for NotBetween<T, U> where
Self: Expression, Self: Expression,
<Self as Expression>::SqlType: Add,
<<Self as Expression>::SqlType as Add>::Rhs: SqlType +
SingleValue,
__Rhs: AsExpression<<<Self as Expression>::SqlType as Add>::Rhs> {
type Output = ops::Add<Self, __Rhs::Expression>;
fn add(self, rhs: __Rhs) -> Self::Output {
ops::Add::new(self, rhs.as_expression())
}
}
impl<T, U, __Rhs> ::core::ops::Sub<__Rhs> for NotBetween<T, U> where
Self: Expression, Self: Expression,
<Self as Expression>::SqlType: Sub,
<<Self as Expression>::SqlType as Sub>::Rhs: SqlType +
SingleValue,
__Rhs: AsExpression<<<Self as Expression>::SqlType as Sub>::Rhs> {
type Output = ops::Sub<Self, __Rhs::Expression>;
fn sub(self, rhs: __Rhs) -> Self::Output {
ops::Sub::new(self, rhs.as_expression())
}
}
impl<T, U, __Rhs> ::core::ops::Mul<__Rhs> for NotBetween<T, U> where
Self: Expression, Self: Expression,
<Self as Expression>::SqlType: Mul,
<<Self as Expression>::SqlType as Mul>::Rhs: SqlType +
SingleValue,
__Rhs: AsExpression<<<Self as Expression>::SqlType as Mul>::Rhs> {
type Output = ops::Mul<Self, __Rhs::Expression>;
fn mul(self, rhs: __Rhs) -> Self::Output {
ops::Mul::new(self, rhs.as_expression())
}
}
impl<T, U, __Rhs> ::core::ops::Div<__Rhs> for NotBetween<T, U> where
Self: Expression, Self: Expression,
<Self as Expression>::SqlType: Div,
<<Self as Expression>::SqlType as Div>::Rhs: SqlType +
SingleValue,
__Rhs: AsExpression<<<Self as Expression>::SqlType as Div>::Rhs> {
type Output = ops::Div<Self, __Rhs::Expression>;
fn div(self, rhs: __Rhs) -> Self::Output {
ops::Div::new(self, rhs.as_expression())
}
}
};
const _: () =
{
use diesel;
impl<T, U, __GroupByClause>
diesel::expression::ValidGrouping<__GroupByClause> for
NotBetween<T, U> where
T: diesel::expression::ValidGrouping<__GroupByClause>,
U: diesel::expression::ValidGrouping<__GroupByClause>,
<T as
diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate: diesel::expression::MixedAggregates<<U
as
diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate>
{
type IsAggregate =
<<T as
diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate
as
diesel::expression::MixedAggregates<<U as
diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate>>::Output;
}
};
impl<T, U> NotBetween<T, U> {
#[allow(dead_code)]
pub(crate) fn new(left: T, right: U) -> Self {
NotBetween { left, right }
}
}
impl<T, U, QS> crate::expression::SelectableExpression<QS> for
NotBetween<T, U> where
NotBetween<T, U>: crate::expression::AppearsOnTable<QS>,
T: crate::expression::SelectableExpression<QS>,
U: crate::expression::SelectableExpression<QS> {}
impl<T, U, QS> crate::expression::AppearsOnTable<QS> for NotBetween<T, U>
where NotBetween<T, U>: crate::expression::Expression,
T: crate::expression::AppearsOnTable<QS>,
U: crate::expression::AppearsOnTable<QS> {}
impl<T, U> crate::expression::Expression for NotBetween<T, U> where
T: crate::expression::Expression, U: crate::expression::Expression,
<T as crate::expression::Expression>::SqlType: crate::sql_types::SqlType,
<U as crate::expression::Expression>::SqlType: crate::sql_types::SqlType,
crate::sql_types::is_nullable::IsSqlTypeNullable<<T as
crate::expression::Expression>::SqlType>: crate::sql_types::OneIsNullable<crate::sql_types::is_nullable::IsSqlTypeNullable<<U
as crate::expression::Expression>::SqlType>>,
crate::sql_types::is_nullable::IsOneNullable<<T as
crate::expression::Expression>::SqlType,
<U as
crate::expression::Expression>::SqlType>: crate::sql_types::MaybeNullableType<crate::sql_types::Bool>
{
type SqlType =
crate::sql_types::is_nullable::MaybeNullable<crate::sql_types::is_nullable::IsOneNullable<<T
as crate::expression::Expression>::SqlType,
<U as crate::expression::Expression>::SqlType>,
crate::sql_types::Bool>;
}
impl<T, U, DB> crate::query_builder::QueryFragment<DB> for NotBetween<T, U>
where T: crate::query_builder::QueryFragment<DB>,
U: crate::query_builder::QueryFragment<DB>, DB: crate::backend::Backend {
fn walk_ast<'b>(&'b self,
mut out: crate::query_builder::AstPass<'_, 'b, DB>)
-> crate::result::QueryResult<()> {
self.left.walk_ast(out.reborrow())?;
out.push_sql(" NOT BETWEEN ");
self.right.walk_ast(out.reborrow())?;
;
Ok(())
}
}
impl<S, T, U> crate::internal::operators_macro::FieldAliasMapper<S> for
NotBetween<T, U> where S: crate::query_source::AliasSource,
T: crate::internal::operators_macro::FieldAliasMapper<S>,
U: crate::internal::operators_macro::FieldAliasMapper<S> {
type Out =
NotBetween<<T as
crate::internal::operators_macro::FieldAliasMapper<S>>::Out,
<U as crate::internal::operators_macro::FieldAliasMapper<S>>::Out>;
fn map(self, alias: &crate::query_source::Alias<S>) -> Self::Out {
NotBetween {
left: self.left.map(alias),
right: self.right.map(alias),
}
}
}infix_operator!(NotBetween, " NOT BETWEEN ");
625
626#[doc(hidden)]
#[allow(unreachable_pub)]
pub struct RetrieveAsTextJson<T, U> {
pub(crate) left: T,
pub(crate) right: U,
}
#[automatically_derived]
#[allow(unreachable_pub)]
impl<T: ::core::fmt::Debug, U: ::core::fmt::Debug> ::core::fmt::Debug for
RetrieveAsTextJson<T, U> {
#[inline]
fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
::core::fmt::Formatter::debug_struct_field2_finish(f,
"RetrieveAsTextJson", "left", &self.left, "right", &&self.right)
}
}
#[automatically_derived]
#[allow(unreachable_pub)]
impl<T: ::core::clone::Clone, U: ::core::clone::Clone> ::core::clone::Clone
for RetrieveAsTextJson<T, U> {
#[inline]
fn clone(&self) -> RetrieveAsTextJson<T, U> {
RetrieveAsTextJson {
left: ::core::clone::Clone::clone(&self.left),
right: ::core::clone::Clone::clone(&self.right),
}
}
}
#[automatically_derived]
#[allow(unreachable_pub)]
impl<T: ::core::marker::Copy, U: ::core::marker::Copy> ::core::marker::Copy
for RetrieveAsTextJson<T, U> {
}
const _: () =
{
use diesel;
#[allow(non_camel_case_types)]
impl<T: diesel::query_builder::QueryId,
U: diesel::query_builder::QueryId> diesel::query_builder::QueryId
for RetrieveAsTextJson<T, U> {
type QueryId =
RetrieveAsTextJson<<T as
diesel::query_builder::QueryId>::QueryId,
<U as diesel::query_builder::QueryId>::QueryId>;
const HAS_STATIC_QUERY_ID: bool =
<T as diesel::query_builder::QueryId>::HAS_STATIC_QUERY_ID &&
<U as diesel::query_builder::QueryId>::HAS_STATIC_QUERY_ID
&& true;
const IS_WINDOW_FUNCTION: bool =
<T as diesel::query_builder::QueryId>::IS_WINDOW_FUNCTION ||
<U as diesel::query_builder::QueryId>::IS_WINDOW_FUNCTION ||
false;
}
};
const _: () =
{
use diesel;
use diesel::internal::derives::numeric_ops as ops;
use diesel::expression::{Expression, AsExpression};
use diesel::sql_types::ops::{Add, Sub, Mul, Div};
use diesel::sql_types::{SqlType, SingleValue};
impl<T, U, __Rhs> ::core::ops::Add<__Rhs> for RetrieveAsTextJson<T, U>
where Self: Expression, Self: Expression,
<Self as Expression>::SqlType: Add,
<<Self as Expression>::SqlType as Add>::Rhs: SqlType +
SingleValue,
__Rhs: AsExpression<<<Self as Expression>::SqlType as Add>::Rhs> {
type Output = ops::Add<Self, __Rhs::Expression>;
fn add(self, rhs: __Rhs) -> Self::Output {
ops::Add::new(self, rhs.as_expression())
}
}
impl<T, U, __Rhs> ::core::ops::Sub<__Rhs> for RetrieveAsTextJson<T, U>
where Self: Expression, Self: Expression,
<Self as Expression>::SqlType: Sub,
<<Self as Expression>::SqlType as Sub>::Rhs: SqlType +
SingleValue,
__Rhs: AsExpression<<<Self as Expression>::SqlType as Sub>::Rhs> {
type Output = ops::Sub<Self, __Rhs::Expression>;
fn sub(self, rhs: __Rhs) -> Self::Output {
ops::Sub::new(self, rhs.as_expression())
}
}
impl<T, U, __Rhs> ::core::ops::Mul<__Rhs> for RetrieveAsTextJson<T, U>
where Self: Expression, Self: Expression,
<Self as Expression>::SqlType: Mul,
<<Self as Expression>::SqlType as Mul>::Rhs: SqlType +
SingleValue,
__Rhs: AsExpression<<<Self as Expression>::SqlType as Mul>::Rhs> {
type Output = ops::Mul<Self, __Rhs::Expression>;
fn mul(self, rhs: __Rhs) -> Self::Output {
ops::Mul::new(self, rhs.as_expression())
}
}
impl<T, U, __Rhs> ::core::ops::Div<__Rhs> for RetrieveAsTextJson<T, U>
where Self: Expression, Self: Expression,
<Self as Expression>::SqlType: Div,
<<Self as Expression>::SqlType as Div>::Rhs: SqlType +
SingleValue,
__Rhs: AsExpression<<<Self as Expression>::SqlType as Div>::Rhs> {
type Output = ops::Div<Self, __Rhs::Expression>;
fn div(self, rhs: __Rhs) -> Self::Output {
ops::Div::new(self, rhs.as_expression())
}
}
};
const _: () =
{
use diesel;
impl<T, U, __GroupByClause>
diesel::expression::ValidGrouping<__GroupByClause> for
RetrieveAsTextJson<T, U> where
T: diesel::expression::ValidGrouping<__GroupByClause>,
U: diesel::expression::ValidGrouping<__GroupByClause>,
<T as
diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate: diesel::expression::MixedAggregates<<U
as
diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate>
{
type IsAggregate =
<<T as
diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate
as
diesel::expression::MixedAggregates<<U as
diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate>>::Output;
}
};
impl<T, U> RetrieveAsTextJson<T, U> {
#[allow(dead_code)]
pub(crate) fn new(left: T, right: U) -> Self {
RetrieveAsTextJson { left, right }
}
}
impl<T, U, QS> crate::expression::SelectableExpression<QS> for
RetrieveAsTextJson<T, U> where
RetrieveAsTextJson<T, U>: crate::expression::AppearsOnTable<QS>,
T: crate::expression::SelectableExpression<QS>,
U: crate::expression::SelectableExpression<QS> {}
impl<T, U, QS> crate::expression::AppearsOnTable<QS> for
RetrieveAsTextJson<T, U> where
RetrieveAsTextJson<T, U>: crate::expression::Expression,
T: crate::expression::AppearsOnTable<QS>,
U: crate::expression::AppearsOnTable<QS> {}
impl<T, U> crate::expression::Expression for RetrieveAsTextJson<T, U> where
T: crate::expression::Expression, U: crate::expression::Expression,
<T as crate::expression::Expression>::SqlType: crate::sql_types::SqlType,
<U as crate::expression::Expression>::SqlType: crate::sql_types::SqlType,
crate::sql_types::is_nullable::IsSqlTypeNullable<<T as
crate::expression::Expression>::SqlType>: crate::sql_types::OneIsNullable<crate::sql_types::is_nullable::IsSqlTypeNullable<<U
as crate::expression::Expression>::SqlType>>,
crate::sql_types::is_nullable::IsOneNullable<<T as
crate::expression::Expression>::SqlType,
<U as
crate::expression::Expression>::SqlType>: crate::sql_types::MaybeNullableType<crate::sql_types::Text>
{
type SqlType =
crate::sql_types::is_nullable::MaybeNullable<crate::sql_types::is_nullable::IsOneNullable<<T
as crate::expression::Expression>::SqlType,
<U as crate::expression::Expression>::SqlType>,
crate::sql_types::Text>;
}
impl<T, U, DB> crate::query_builder::QueryFragment<DB> for
RetrieveAsTextJson<T, U> where T: crate::query_builder::QueryFragment<DB>,
U: crate::query_builder::QueryFragment<DB>, DB: crate::backend::Backend {
fn walk_ast<'b>(&'b self,
mut out: crate::query_builder::AstPass<'_, 'b, DB>)
-> crate::result::QueryResult<()> {
self.left.walk_ast(out.reborrow())?;
out.push_sql(" ->> ");
self.right.walk_ast(out.reborrow())?;
;
Ok(())
}
}
impl<S, T, U> crate::internal::operators_macro::FieldAliasMapper<S> for
RetrieveAsTextJson<T, U> where S: crate::query_source::AliasSource,
T: crate::internal::operators_macro::FieldAliasMapper<S>,
U: crate::internal::operators_macro::FieldAliasMapper<S> {
type Out =
RetrieveAsTextJson<<T as
crate::internal::operators_macro::FieldAliasMapper<S>>::Out,
<U as crate::internal::operators_macro::FieldAliasMapper<S>>::Out>;
fn map(self, alias: &crate::query_source::Alias<S>) -> Self::Out {
RetrieveAsTextJson {
left: self.left.map(alias),
right: self.right.map(alias),
}
}
}infix_operator!(RetrieveAsTextJson, " ->> ", crate::sql_types::Text);
627
628#[doc(hidden)]
#[allow(unreachable_pub)]
pub struct IsNull<Expr> {
pub(crate) expr: Expr,
}
#[automatically_derived]
#[allow(unreachable_pub)]
impl<Expr: ::core::fmt::Debug> ::core::fmt::Debug for IsNull<Expr> {
#[inline]
fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
::core::fmt::Formatter::debug_struct_field1_finish(f, "IsNull",
"expr", &&self.expr)
}
}
#[automatically_derived]
#[allow(unreachable_pub)]
impl<Expr: ::core::clone::Clone> ::core::clone::Clone for IsNull<Expr> {
#[inline]
fn clone(&self) -> IsNull<Expr> {
IsNull { expr: ::core::clone::Clone::clone(&self.expr) }
}
}
#[automatically_derived]
#[allow(unreachable_pub)]
impl<Expr: ::core::marker::Copy> ::core::marker::Copy for IsNull<Expr> { }
const _: () =
{
use diesel;
#[allow(non_camel_case_types)]
impl<Expr: diesel::query_builder::QueryId>
diesel::query_builder::QueryId for IsNull<Expr> {
type QueryId =
IsNull<<Expr as diesel::query_builder::QueryId>::QueryId>;
const HAS_STATIC_QUERY_ID: bool =
<Expr as diesel::query_builder::QueryId>::HAS_STATIC_QUERY_ID
&& true;
const IS_WINDOW_FUNCTION: bool =
<Expr as diesel::query_builder::QueryId>::IS_WINDOW_FUNCTION
|| false;
}
};
const _: () =
{
use diesel;
use diesel::internal::derives::numeric_ops as ops;
use diesel::expression::{Expression, AsExpression};
use diesel::sql_types::ops::{Add, Sub, Mul, Div};
use diesel::sql_types::{SqlType, SingleValue};
impl<Expr, __Rhs> ::core::ops::Add<__Rhs> for IsNull<Expr> where
Self: Expression, Self: Expression,
<Self as Expression>::SqlType: Add,
<<Self as Expression>::SqlType as Add>::Rhs: SqlType +
SingleValue,
__Rhs: AsExpression<<<Self as Expression>::SqlType as Add>::Rhs> {
type Output = ops::Add<Self, __Rhs::Expression>;
fn add(self, rhs: __Rhs) -> Self::Output {
ops::Add::new(self, rhs.as_expression())
}
}
impl<Expr, __Rhs> ::core::ops::Sub<__Rhs> for IsNull<Expr> where
Self: Expression, Self: Expression,
<Self as Expression>::SqlType: Sub,
<<Self as Expression>::SqlType as Sub>::Rhs: SqlType +
SingleValue,
__Rhs: AsExpression<<<Self as Expression>::SqlType as Sub>::Rhs> {
type Output = ops::Sub<Self, __Rhs::Expression>;
fn sub(self, rhs: __Rhs) -> Self::Output {
ops::Sub::new(self, rhs.as_expression())
}
}
impl<Expr, __Rhs> ::core::ops::Mul<__Rhs> for IsNull<Expr> where
Self: Expression, Self: Expression,
<Self as Expression>::SqlType: Mul,
<<Self as Expression>::SqlType as Mul>::Rhs: SqlType +
SingleValue,
__Rhs: AsExpression<<<Self as Expression>::SqlType as Mul>::Rhs> {
type Output = ops::Mul<Self, __Rhs::Expression>;
fn mul(self, rhs: __Rhs) -> Self::Output {
ops::Mul::new(self, rhs.as_expression())
}
}
impl<Expr, __Rhs> ::core::ops::Div<__Rhs> for IsNull<Expr> where
Self: Expression, Self: Expression,
<Self as Expression>::SqlType: Div,
<<Self as Expression>::SqlType as Div>::Rhs: SqlType +
SingleValue,
__Rhs: AsExpression<<<Self as Expression>::SqlType as Div>::Rhs> {
type Output = ops::Div<Self, __Rhs::Expression>;
fn div(self, rhs: __Rhs) -> Self::Output {
ops::Div::new(self, rhs.as_expression())
}
}
};
const _: () =
{
use diesel;
impl<Expr, __GroupByClause>
diesel::expression::ValidGrouping<__GroupByClause> for
IsNull<Expr> where
Expr: diesel::expression::ValidGrouping<__GroupByClause> {
type IsAggregate =
<Expr as
diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate;
}
};
impl<Expr> IsNull<Expr> {
#[allow(dead_code)]
pub(crate) fn new(expr: Expr) -> Self { IsNull { expr } }
}
impl<Expr, QS> crate::expression::SelectableExpression<QS> for IsNull<Expr>
where IsNull<Expr>: crate::expression::AppearsOnTable<QS>,
Expr: crate::expression::SelectableExpression<QS> {}
impl<Expr, QS> crate::expression::AppearsOnTable<QS> for IsNull<Expr> where
IsNull<Expr>: crate::expression::Expression,
Expr: crate::expression::AppearsOnTable<QS> {}
impl<Expr> crate::expression::Expression for IsNull<Expr> where
Expr: crate::expression::Expression {
type SqlType = crate::sql_types::Bool;
}
impl<Expr, DB> crate::query_builder::QueryFragment<DB> for IsNull<Expr> where
Expr: crate::query_builder::QueryFragment<DB>, DB: crate::backend::Backend
{
fn walk_ast<'b>(&'b self,
mut out: crate::query_builder::AstPass<'_, 'b, DB>)
-> crate::result::QueryResult<()> {
self.expr.walk_ast(out.reborrow())?;
out.push_sql(" IS NULL");
;
Ok(())
}
}
impl<S, Expr> crate::internal::operators_macro::FieldAliasMapper<S> for
IsNull<Expr> where S: crate::query_source::AliasSource,
Expr: crate::internal::operators_macro::FieldAliasMapper<S> {
type Out =
IsNull<<Expr as
crate::internal::operators_macro::FieldAliasMapper<S>>::Out>;
fn map(self, alias: &crate::query_source::Alias<S>) -> Self::Out {
IsNull { expr: self.expr.map(alias) }
}
}postfix_operator!(IsNull, " IS NULL");
629#[doc(hidden)]
#[allow(unreachable_pub)]
pub struct IsNotNull<Expr> {
pub(crate) expr: Expr,
}
#[automatically_derived]
#[allow(unreachable_pub)]
impl<Expr: ::core::fmt::Debug> ::core::fmt::Debug for IsNotNull<Expr> {
#[inline]
fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
::core::fmt::Formatter::debug_struct_field1_finish(f, "IsNotNull",
"expr", &&self.expr)
}
}
#[automatically_derived]
#[allow(unreachable_pub)]
impl<Expr: ::core::clone::Clone> ::core::clone::Clone for IsNotNull<Expr> {
#[inline]
fn clone(&self) -> IsNotNull<Expr> {
IsNotNull { expr: ::core::clone::Clone::clone(&self.expr) }
}
}
#[automatically_derived]
#[allow(unreachable_pub)]
impl<Expr: ::core::marker::Copy> ::core::marker::Copy for IsNotNull<Expr> { }
const _: () =
{
use diesel;
#[allow(non_camel_case_types)]
impl<Expr: diesel::query_builder::QueryId>
diesel::query_builder::QueryId for IsNotNull<Expr> {
type QueryId =
IsNotNull<<Expr as diesel::query_builder::QueryId>::QueryId>;
const HAS_STATIC_QUERY_ID: bool =
<Expr as diesel::query_builder::QueryId>::HAS_STATIC_QUERY_ID
&& true;
const IS_WINDOW_FUNCTION: bool =
<Expr as diesel::query_builder::QueryId>::IS_WINDOW_FUNCTION
|| false;
}
};
const _: () =
{
use diesel;
use diesel::internal::derives::numeric_ops as ops;
use diesel::expression::{Expression, AsExpression};
use diesel::sql_types::ops::{Add, Sub, Mul, Div};
use diesel::sql_types::{SqlType, SingleValue};
impl<Expr, __Rhs> ::core::ops::Add<__Rhs> for IsNotNull<Expr> where
Self: Expression, Self: Expression,
<Self as Expression>::SqlType: Add,
<<Self as Expression>::SqlType as Add>::Rhs: SqlType +
SingleValue,
__Rhs: AsExpression<<<Self as Expression>::SqlType as Add>::Rhs> {
type Output = ops::Add<Self, __Rhs::Expression>;
fn add(self, rhs: __Rhs) -> Self::Output {
ops::Add::new(self, rhs.as_expression())
}
}
impl<Expr, __Rhs> ::core::ops::Sub<__Rhs> for IsNotNull<Expr> where
Self: Expression, Self: Expression,
<Self as Expression>::SqlType: Sub,
<<Self as Expression>::SqlType as Sub>::Rhs: SqlType +
SingleValue,
__Rhs: AsExpression<<<Self as Expression>::SqlType as Sub>::Rhs> {
type Output = ops::Sub<Self, __Rhs::Expression>;
fn sub(self, rhs: __Rhs) -> Self::Output {
ops::Sub::new(self, rhs.as_expression())
}
}
impl<Expr, __Rhs> ::core::ops::Mul<__Rhs> for IsNotNull<Expr> where
Self: Expression, Self: Expression,
<Self as Expression>::SqlType: Mul,
<<Self as Expression>::SqlType as Mul>::Rhs: SqlType +
SingleValue,
__Rhs: AsExpression<<<Self as Expression>::SqlType as Mul>::Rhs> {
type Output = ops::Mul<Self, __Rhs::Expression>;
fn mul(self, rhs: __Rhs) -> Self::Output {
ops::Mul::new(self, rhs.as_expression())
}
}
impl<Expr, __Rhs> ::core::ops::Div<__Rhs> for IsNotNull<Expr> where
Self: Expression, Self: Expression,
<Self as Expression>::SqlType: Div,
<<Self as Expression>::SqlType as Div>::Rhs: SqlType +
SingleValue,
__Rhs: AsExpression<<<Self as Expression>::SqlType as Div>::Rhs> {
type Output = ops::Div<Self, __Rhs::Expression>;
fn div(self, rhs: __Rhs) -> Self::Output {
ops::Div::new(self, rhs.as_expression())
}
}
};
const _: () =
{
use diesel;
impl<Expr, __GroupByClause>
diesel::expression::ValidGrouping<__GroupByClause> for
IsNotNull<Expr> where
Expr: diesel::expression::ValidGrouping<__GroupByClause> {
type IsAggregate =
<Expr as
diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate;
}
};
impl<Expr> IsNotNull<Expr> {
#[allow(dead_code)]
pub(crate) fn new(expr: Expr) -> Self { IsNotNull { expr } }
}
impl<Expr, QS> crate::expression::SelectableExpression<QS> for IsNotNull<Expr>
where IsNotNull<Expr>: crate::expression::AppearsOnTable<QS>,
Expr: crate::expression::SelectableExpression<QS> {}
impl<Expr, QS> crate::expression::AppearsOnTable<QS> for IsNotNull<Expr> where
IsNotNull<Expr>: crate::expression::Expression,
Expr: crate::expression::AppearsOnTable<QS> {}
impl<Expr> crate::expression::Expression for IsNotNull<Expr> where
Expr: crate::expression::Expression {
type SqlType = crate::sql_types::Bool;
}
impl<Expr, DB> crate::query_builder::QueryFragment<DB> for IsNotNull<Expr>
where Expr: crate::query_builder::QueryFragment<DB>,
DB: crate::backend::Backend {
fn walk_ast<'b>(&'b self,
mut out: crate::query_builder::AstPass<'_, 'b, DB>)
-> crate::result::QueryResult<()> {
self.expr.walk_ast(out.reborrow())?;
out.push_sql(" IS NOT NULL");
;
Ok(())
}
}
impl<S, Expr> crate::internal::operators_macro::FieldAliasMapper<S> for
IsNotNull<Expr> where S: crate::query_source::AliasSource,
Expr: crate::internal::operators_macro::FieldAliasMapper<S> {
type Out =
IsNotNull<<Expr as
crate::internal::operators_macro::FieldAliasMapper<S>>::Out>;
fn map(self, alias: &crate::query_source::Alias<S>) -> Self::Out {
IsNotNull { expr: self.expr.map(alias) }
}
}postfix_operator!(IsNotNull, " IS NOT NULL");
630#[doc(hidden)]
#[allow(unreachable_pub)]
pub struct Asc<Expr> {
pub(crate) expr: Expr,
}
#[automatically_derived]
#[allow(unreachable_pub)]
impl<Expr: ::core::fmt::Debug> ::core::fmt::Debug for Asc<Expr> {
#[inline]
fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
::core::fmt::Formatter::debug_struct_field1_finish(f, "Asc", "expr",
&&self.expr)
}
}
#[automatically_derived]
#[allow(unreachable_pub)]
impl<Expr: ::core::clone::Clone> ::core::clone::Clone for Asc<Expr> {
#[inline]
fn clone(&self) -> Asc<Expr> {
Asc { expr: ::core::clone::Clone::clone(&self.expr) }
}
}
#[automatically_derived]
#[allow(unreachable_pub)]
impl<Expr: ::core::marker::Copy> ::core::marker::Copy for Asc<Expr> { }
const _: () =
{
use diesel;
#[allow(non_camel_case_types)]
impl<Expr: diesel::query_builder::QueryId>
diesel::query_builder::QueryId for Asc<Expr> {
type QueryId =
Asc<<Expr as diesel::query_builder::QueryId>::QueryId>;
const HAS_STATIC_QUERY_ID: bool =
<Expr as diesel::query_builder::QueryId>::HAS_STATIC_QUERY_ID
&& true;
const IS_WINDOW_FUNCTION: bool =
<Expr as diesel::query_builder::QueryId>::IS_WINDOW_FUNCTION
|| false;
}
};
const _: () =
{
use diesel;
use diesel::internal::derives::numeric_ops as ops;
use diesel::expression::{Expression, AsExpression};
use diesel::sql_types::ops::{Add, Sub, Mul, Div};
use diesel::sql_types::{SqlType, SingleValue};
impl<Expr, __Rhs> ::core::ops::Add<__Rhs> for Asc<Expr> where
Self: Expression, Self: Expression,
<Self as Expression>::SqlType: Add,
<<Self as Expression>::SqlType as Add>::Rhs: SqlType +
SingleValue,
__Rhs: AsExpression<<<Self as Expression>::SqlType as Add>::Rhs> {
type Output = ops::Add<Self, __Rhs::Expression>;
fn add(self, rhs: __Rhs) -> Self::Output {
ops::Add::new(self, rhs.as_expression())
}
}
impl<Expr, __Rhs> ::core::ops::Sub<__Rhs> for Asc<Expr> where
Self: Expression, Self: Expression,
<Self as Expression>::SqlType: Sub,
<<Self as Expression>::SqlType as Sub>::Rhs: SqlType +
SingleValue,
__Rhs: AsExpression<<<Self as Expression>::SqlType as Sub>::Rhs> {
type Output = ops::Sub<Self, __Rhs::Expression>;
fn sub(self, rhs: __Rhs) -> Self::Output {
ops::Sub::new(self, rhs.as_expression())
}
}
impl<Expr, __Rhs> ::core::ops::Mul<__Rhs> for Asc<Expr> where
Self: Expression, Self: Expression,
<Self as Expression>::SqlType: Mul,
<<Self as Expression>::SqlType as Mul>::Rhs: SqlType +
SingleValue,
__Rhs: AsExpression<<<Self as Expression>::SqlType as Mul>::Rhs> {
type Output = ops::Mul<Self, __Rhs::Expression>;
fn mul(self, rhs: __Rhs) -> Self::Output {
ops::Mul::new(self, rhs.as_expression())
}
}
impl<Expr, __Rhs> ::core::ops::Div<__Rhs> for Asc<Expr> where
Self: Expression, Self: Expression,
<Self as Expression>::SqlType: Div,
<<Self as Expression>::SqlType as Div>::Rhs: SqlType +
SingleValue,
__Rhs: AsExpression<<<Self as Expression>::SqlType as Div>::Rhs> {
type Output = ops::Div<Self, __Rhs::Expression>;
fn div(self, rhs: __Rhs) -> Self::Output {
ops::Div::new(self, rhs.as_expression())
}
}
};
const _: () =
{
use diesel;
impl<Expr, __GroupByClause>
diesel::expression::ValidGrouping<__GroupByClause> for Asc<Expr>
where Expr: diesel::expression::ValidGrouping<__GroupByClause> {
type IsAggregate =
<Expr as
diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate;
}
};
impl<Expr> Asc<Expr> {
#[allow(dead_code)]
pub(crate) fn new(expr: Expr) -> Self { Asc { expr } }
}
impl<Expr, QS> crate::expression::SelectableExpression<QS> for Asc<Expr> where
Asc<Expr>: crate::expression::AppearsOnTable<QS>,
Expr: crate::expression::SelectableExpression<QS> {}
impl<Expr, QS> crate::expression::AppearsOnTable<QS> for Asc<Expr> where
Asc<Expr>: crate::expression::Expression,
Expr: crate::expression::AppearsOnTable<QS> {}
impl<Expr> crate::expression::Expression for Asc<Expr> where
Expr: crate::expression::Expression {
type SqlType = crate::expression::expression_types::NotSelectable;
}
impl<Expr, DB> crate::query_builder::QueryFragment<DB> for Asc<Expr> where
Expr: crate::query_builder::QueryFragment<DB>, DB: crate::backend::Backend
{
fn walk_ast<'b>(&'b self,
mut out: crate::query_builder::AstPass<'_, 'b, DB>)
-> crate::result::QueryResult<()> {
self.expr.walk_ast(out.reborrow())?;
out.push_sql(" ASC");
;
Ok(())
}
}
impl<S, Expr> crate::internal::operators_macro::FieldAliasMapper<S> for
Asc<Expr> where S: crate::query_source::AliasSource,
Expr: crate::internal::operators_macro::FieldAliasMapper<S> {
type Out =
Asc<<Expr as
crate::internal::operators_macro::FieldAliasMapper<S>>::Out>;
fn map(self, alias: &crate::query_source::Alias<S>) -> Self::Out {
Asc { expr: self.expr.map(alias) }
}
}postfix_operator!(
631 Asc,
632 " ASC",
633 crate::expression::expression_types::NotSelectable
634);
635#[doc(hidden)]
#[allow(unreachable_pub)]
pub struct Desc<Expr> {
pub(crate) expr: Expr,
}
#[automatically_derived]
#[allow(unreachable_pub)]
impl<Expr: ::core::fmt::Debug> ::core::fmt::Debug for Desc<Expr> {
#[inline]
fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
::core::fmt::Formatter::debug_struct_field1_finish(f, "Desc", "expr",
&&self.expr)
}
}
#[automatically_derived]
#[allow(unreachable_pub)]
impl<Expr: ::core::clone::Clone> ::core::clone::Clone for Desc<Expr> {
#[inline]
fn clone(&self) -> Desc<Expr> {
Desc { expr: ::core::clone::Clone::clone(&self.expr) }
}
}
#[automatically_derived]
#[allow(unreachable_pub)]
impl<Expr: ::core::marker::Copy> ::core::marker::Copy for Desc<Expr> { }
const _: () =
{
use diesel;
#[allow(non_camel_case_types)]
impl<Expr: diesel::query_builder::QueryId>
diesel::query_builder::QueryId for Desc<Expr> {
type QueryId =
Desc<<Expr as diesel::query_builder::QueryId>::QueryId>;
const HAS_STATIC_QUERY_ID: bool =
<Expr as diesel::query_builder::QueryId>::HAS_STATIC_QUERY_ID
&& true;
const IS_WINDOW_FUNCTION: bool =
<Expr as diesel::query_builder::QueryId>::IS_WINDOW_FUNCTION
|| false;
}
};
const _: () =
{
use diesel;
use diesel::internal::derives::numeric_ops as ops;
use diesel::expression::{Expression, AsExpression};
use diesel::sql_types::ops::{Add, Sub, Mul, Div};
use diesel::sql_types::{SqlType, SingleValue};
impl<Expr, __Rhs> ::core::ops::Add<__Rhs> for Desc<Expr> where
Self: Expression, Self: Expression,
<Self as Expression>::SqlType: Add,
<<Self as Expression>::SqlType as Add>::Rhs: SqlType +
SingleValue,
__Rhs: AsExpression<<<Self as Expression>::SqlType as Add>::Rhs> {
type Output = ops::Add<Self, __Rhs::Expression>;
fn add(self, rhs: __Rhs) -> Self::Output {
ops::Add::new(self, rhs.as_expression())
}
}
impl<Expr, __Rhs> ::core::ops::Sub<__Rhs> for Desc<Expr> where
Self: Expression, Self: Expression,
<Self as Expression>::SqlType: Sub,
<<Self as Expression>::SqlType as Sub>::Rhs: SqlType +
SingleValue,
__Rhs: AsExpression<<<Self as Expression>::SqlType as Sub>::Rhs> {
type Output = ops::Sub<Self, __Rhs::Expression>;
fn sub(self, rhs: __Rhs) -> Self::Output {
ops::Sub::new(self, rhs.as_expression())
}
}
impl<Expr, __Rhs> ::core::ops::Mul<__Rhs> for Desc<Expr> where
Self: Expression, Self: Expression,
<Self as Expression>::SqlType: Mul,
<<Self as Expression>::SqlType as Mul>::Rhs: SqlType +
SingleValue,
__Rhs: AsExpression<<<Self as Expression>::SqlType as Mul>::Rhs> {
type Output = ops::Mul<Self, __Rhs::Expression>;
fn mul(self, rhs: __Rhs) -> Self::Output {
ops::Mul::new(self, rhs.as_expression())
}
}
impl<Expr, __Rhs> ::core::ops::Div<__Rhs> for Desc<Expr> where
Self: Expression, Self: Expression,
<Self as Expression>::SqlType: Div,
<<Self as Expression>::SqlType as Div>::Rhs: SqlType +
SingleValue,
__Rhs: AsExpression<<<Self as Expression>::SqlType as Div>::Rhs> {
type Output = ops::Div<Self, __Rhs::Expression>;
fn div(self, rhs: __Rhs) -> Self::Output {
ops::Div::new(self, rhs.as_expression())
}
}
};
const _: () =
{
use diesel;
impl<Expr, __GroupByClause>
diesel::expression::ValidGrouping<__GroupByClause> for Desc<Expr>
where Expr: diesel::expression::ValidGrouping<__GroupByClause> {
type IsAggregate =
<Expr as
diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate;
}
};
impl<Expr> Desc<Expr> {
#[allow(dead_code)]
pub(crate) fn new(expr: Expr) -> Self { Desc { expr } }
}
impl<Expr, QS> crate::expression::SelectableExpression<QS> for Desc<Expr>
where Desc<Expr>: crate::expression::AppearsOnTable<QS>,
Expr: crate::expression::SelectableExpression<QS> {}
impl<Expr, QS> crate::expression::AppearsOnTable<QS> for Desc<Expr> where
Desc<Expr>: crate::expression::Expression,
Expr: crate::expression::AppearsOnTable<QS> {}
impl<Expr> crate::expression::Expression for Desc<Expr> where
Expr: crate::expression::Expression {
type SqlType = crate::expression::expression_types::NotSelectable;
}
impl<Expr, DB> crate::query_builder::QueryFragment<DB> for Desc<Expr> where
Expr: crate::query_builder::QueryFragment<DB>, DB: crate::backend::Backend
{
fn walk_ast<'b>(&'b self,
mut out: crate::query_builder::AstPass<'_, 'b, DB>)
-> crate::result::QueryResult<()> {
self.expr.walk_ast(out.reborrow())?;
out.push_sql(" DESC");
;
Ok(())
}
}
impl<S, Expr> crate::internal::operators_macro::FieldAliasMapper<S> for
Desc<Expr> where S: crate::query_source::AliasSource,
Expr: crate::internal::operators_macro::FieldAliasMapper<S> {
type Out =
Desc<<Expr as
crate::internal::operators_macro::FieldAliasMapper<S>>::Out>;
fn map(self, alias: &crate::query_source::Alias<S>) -> Self::Out {
Desc { expr: self.expr.map(alias) }
}
}postfix_operator!(
636 Desc,
637 " DESC",
638 crate::expression::expression_types::NotSelectable
639);
640
641#[doc(hidden)]
#[allow(unreachable_pub)]
pub struct Not<Expr> {
pub(crate) expr: Expr,
}
#[automatically_derived]
#[allow(unreachable_pub)]
impl<Expr: ::core::fmt::Debug> ::core::fmt::Debug for Not<Expr> {
#[inline]
fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
::core::fmt::Formatter::debug_struct_field1_finish(f, "Not", "expr",
&&self.expr)
}
}
#[automatically_derived]
#[allow(unreachable_pub)]
impl<Expr: ::core::clone::Clone> ::core::clone::Clone for Not<Expr> {
#[inline]
fn clone(&self) -> Not<Expr> {
Not { expr: ::core::clone::Clone::clone(&self.expr) }
}
}
#[automatically_derived]
#[allow(unreachable_pub)]
impl<Expr: ::core::marker::Copy> ::core::marker::Copy for Not<Expr> { }
const _: () =
{
use diesel;
#[allow(non_camel_case_types)]
impl<Expr: diesel::query_builder::QueryId>
diesel::query_builder::QueryId for Not<Expr> {
type QueryId =
Not<<Expr as diesel::query_builder::QueryId>::QueryId>;
const HAS_STATIC_QUERY_ID: bool =
<Expr as diesel::query_builder::QueryId>::HAS_STATIC_QUERY_ID
&& true;
const IS_WINDOW_FUNCTION: bool =
<Expr as diesel::query_builder::QueryId>::IS_WINDOW_FUNCTION
|| false;
}
};
const _: () =
{
use diesel;
use diesel::internal::derives::numeric_ops as ops;
use diesel::expression::{Expression, AsExpression};
use diesel::sql_types::ops::{Add, Sub, Mul, Div};
use diesel::sql_types::{SqlType, SingleValue};
impl<Expr, __Rhs> ::core::ops::Add<__Rhs> for Not<Expr> where
Self: Expression, Self: Expression,
<Self as Expression>::SqlType: Add,
<<Self as Expression>::SqlType as Add>::Rhs: SqlType +
SingleValue,
__Rhs: AsExpression<<<Self as Expression>::SqlType as Add>::Rhs> {
type Output = ops::Add<Self, __Rhs::Expression>;
fn add(self, rhs: __Rhs) -> Self::Output {
ops::Add::new(self, rhs.as_expression())
}
}
impl<Expr, __Rhs> ::core::ops::Sub<__Rhs> for Not<Expr> where
Self: Expression, Self: Expression,
<Self as Expression>::SqlType: Sub,
<<Self as Expression>::SqlType as Sub>::Rhs: SqlType +
SingleValue,
__Rhs: AsExpression<<<Self as Expression>::SqlType as Sub>::Rhs> {
type Output = ops::Sub<Self, __Rhs::Expression>;
fn sub(self, rhs: __Rhs) -> Self::Output {
ops::Sub::new(self, rhs.as_expression())
}
}
impl<Expr, __Rhs> ::core::ops::Mul<__Rhs> for Not<Expr> where
Self: Expression, Self: Expression,
<Self as Expression>::SqlType: Mul,
<<Self as Expression>::SqlType as Mul>::Rhs: SqlType +
SingleValue,
__Rhs: AsExpression<<<Self as Expression>::SqlType as Mul>::Rhs> {
type Output = ops::Mul<Self, __Rhs::Expression>;
fn mul(self, rhs: __Rhs) -> Self::Output {
ops::Mul::new(self, rhs.as_expression())
}
}
impl<Expr, __Rhs> ::core::ops::Div<__Rhs> for Not<Expr> where
Self: Expression, Self: Expression,
<Self as Expression>::SqlType: Div,
<<Self as Expression>::SqlType as Div>::Rhs: SqlType +
SingleValue,
__Rhs: AsExpression<<<Self as Expression>::SqlType as Div>::Rhs> {
type Output = ops::Div<Self, __Rhs::Expression>;
fn div(self, rhs: __Rhs) -> Self::Output {
ops::Div::new(self, rhs.as_expression())
}
}
};
const _: () =
{
use diesel;
impl<Expr, __GroupByClause>
diesel::expression::ValidGrouping<__GroupByClause> for Not<Expr>
where Expr: diesel::expression::ValidGrouping<__GroupByClause> {
type IsAggregate =
<Expr as
diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate;
}
};
impl<Expr> Not<Expr> {
#[allow(dead_code)]
pub(crate) fn new(expr: Expr) -> Self { Not { expr } }
}
impl<Expr, QS> crate::expression::SelectableExpression<QS> for Not<Expr> where
Not<Expr>: crate::expression::AppearsOnTable<QS>,
Expr: crate::expression::SelectableExpression<QS> {}
impl<Expr, QS> crate::expression::AppearsOnTable<QS> for Not<Expr> where
Not<Expr>: crate::expression::Expression,
Expr: crate::expression::AppearsOnTable<QS> {}
impl<Expr> crate::expression::Expression for Not<Expr> where
Expr: crate::expression::Expression,
<Expr as
crate::expression::Expression>::SqlType: crate::sql_types::SqlType,
crate::sql_types::is_nullable::IsSqlTypeNullable<<Expr as
crate::expression::Expression>::SqlType>: crate::sql_types::MaybeNullableType<crate::sql_types::Bool>
{
type SqlType =
crate::sql_types::is_nullable::MaybeNullable<crate::sql_types::is_nullable::IsSqlTypeNullable<<Expr
as crate::expression::Expression>::SqlType>, crate::sql_types::Bool>;
}
impl<Expr, DB> crate::query_builder::QueryFragment<DB> for Not<Expr> where
Expr: crate::query_builder::QueryFragment<DB>, DB: crate::backend::Backend
{
fn walk_ast<'b>(&'b self,
mut out: crate::query_builder::AstPass<'_, 'b, DB>)
-> crate::result::QueryResult<()> {
out.push_sql(" NOT ");
self.expr.walk_ast(out.reborrow())?;
;
Ok(())
}
}
impl<S, Expr> crate::internal::operators_macro::FieldAliasMapper<S> for
Not<Expr> where S: crate::query_source::AliasSource,
Expr: crate::internal::operators_macro::FieldAliasMapper<S> {
type Out =
Not<<Expr as
crate::internal::operators_macro::FieldAliasMapper<S>>::Out>;
fn map(self, alias: &crate::query_source::Alias<S>) -> Self::Out {
Not { expr: self.expr.map(alias) }
}
}prefix_operator!(Not, " NOT ");
642
643use crate::backend::{Backend, SqlDialect, sql_dialect};
644use crate::expression::{TypedExpressionType, ValidGrouping};
645use crate::insertable::{ColumnInsertValue, Insertable};
646use crate::query_builder::{QueryFragment, QueryId, ValuesClause};
647use crate::query_source::Column;
648use crate::sql_types::{DieselNumericOps, SqlType};
649
650impl<T, U> Insertable<T::Table> for Eq<T, U>
651where
652 T: Column,
653{
654 type Values = ValuesClause<ColumnInsertValue<T, U>, T::Table>;
655
656 fn values(self) -> Self::Values {
657 ValuesClause::new(ColumnInsertValue::new(self.right))
658 }
659}
660
661impl<'a, T, Tab, U> Insertable<Tab> for &'a Eq<T, U>
662where
663 T: Copy,
664 Eq<T, &'a U>: Insertable<Tab>,
665{
666 type Values = <Eq<T, &'a U> as Insertable<Tab>>::Values;
667
668 fn values(self) -> Self::Values {
669 Eq::new(self.left, &self.right).values()
670 }
671}
672
673#[doc = " This type represents a string concat operator"]
#[non_exhaustive]
pub struct Concat<L, R> {
#[doc = " The left side expression of the operator"]
pub left: L,
#[doc = " The right side expression of the operator"]
pub right: R,
}#[diesel_derives::__diesel_public_if(
675 feature = "i-implement-a-third-party-backend-and-opt-into-breaking-changes",
676 public_fields(left, right)
677)]
678#[derive(#[automatically_derived]
impl<L: ::core::fmt::Debug, R: ::core::fmt::Debug> ::core::fmt::Debug for
Concat<L, R> {
#[inline]
fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
::core::fmt::Formatter::debug_struct_field2_finish(f, "Concat",
"left", &self.left, "right", &&self.right)
}
}Debug, #[automatically_derived]
impl<L: ::core::clone::Clone, R: ::core::clone::Clone> ::core::clone::Clone
for Concat<L, R> {
#[inline]
fn clone(&self) -> Concat<L, R> {
Concat {
left: ::core::clone::Clone::clone(&self.left),
right: ::core::clone::Clone::clone(&self.right),
}
}
}Clone, #[automatically_derived]
impl<L: ::core::marker::Copy, R: ::core::marker::Copy> ::core::marker::Copy
for Concat<L, R> {
}Copy, const _: () =
{
use diesel;
#[allow(non_camel_case_types)]
impl<L: diesel::query_builder::QueryId,
R: diesel::query_builder::QueryId> diesel::query_builder::QueryId
for Concat<L, R> {
type QueryId =
Concat<<L as diesel::query_builder::QueryId>::QueryId,
<R as diesel::query_builder::QueryId>::QueryId>;
const HAS_STATIC_QUERY_ID: bool =
<L as diesel::query_builder::QueryId>::HAS_STATIC_QUERY_ID &&
<R as diesel::query_builder::QueryId>::HAS_STATIC_QUERY_ID
&& true;
const IS_WINDOW_FUNCTION: bool =
<L as diesel::query_builder::QueryId>::IS_WINDOW_FUNCTION ||
<R as diesel::query_builder::QueryId>::IS_WINDOW_FUNCTION ||
false;
}
};QueryId, const _: () =
{
use diesel;
use diesel::internal::derives::numeric_ops as ops;
use diesel::expression::{Expression, AsExpression};
use diesel::sql_types::ops::{Add, Sub, Mul, Div};
use diesel::sql_types::{SqlType, SingleValue};
impl<L, R, __Rhs> ::core::ops::Add<__Rhs> for Concat<L, R> where
Self: Expression, Self: Expression,
<Self as Expression>::SqlType: Add,
<<Self as Expression>::SqlType as Add>::Rhs: SqlType +
SingleValue,
__Rhs: AsExpression<<<Self as Expression>::SqlType as Add>::Rhs> {
type Output = ops::Add<Self, __Rhs::Expression>;
fn add(self, rhs: __Rhs) -> Self::Output {
ops::Add::new(self, rhs.as_expression())
}
}
impl<L, R, __Rhs> ::core::ops::Sub<__Rhs> for Concat<L, R> where
Self: Expression, Self: Expression,
<Self as Expression>::SqlType: Sub,
<<Self as Expression>::SqlType as Sub>::Rhs: SqlType +
SingleValue,
__Rhs: AsExpression<<<Self as Expression>::SqlType as Sub>::Rhs> {
type Output = ops::Sub<Self, __Rhs::Expression>;
fn sub(self, rhs: __Rhs) -> Self::Output {
ops::Sub::new(self, rhs.as_expression())
}
}
impl<L, R, __Rhs> ::core::ops::Mul<__Rhs> for Concat<L, R> where
Self: Expression, Self: Expression,
<Self as Expression>::SqlType: Mul,
<<Self as Expression>::SqlType as Mul>::Rhs: SqlType +
SingleValue,
__Rhs: AsExpression<<<Self as Expression>::SqlType as Mul>::Rhs> {
type Output = ops::Mul<Self, __Rhs::Expression>;
fn mul(self, rhs: __Rhs) -> Self::Output {
ops::Mul::new(self, rhs.as_expression())
}
}
impl<L, R, __Rhs> ::core::ops::Div<__Rhs> for Concat<L, R> where
Self: Expression, Self: Expression,
<Self as Expression>::SqlType: Div,
<<Self as Expression>::SqlType as Div>::Rhs: SqlType +
SingleValue,
__Rhs: AsExpression<<<Self as Expression>::SqlType as Div>::Rhs> {
type Output = ops::Div<Self, __Rhs::Expression>;
fn div(self, rhs: __Rhs) -> Self::Output {
ops::Div::new(self, rhs.as_expression())
}
}
};DieselNumericOps, const _: () =
{
use diesel;
impl<L, R, __GroupByClause>
diesel::expression::ValidGrouping<__GroupByClause> for
Concat<L, R> where
L: diesel::expression::ValidGrouping<__GroupByClause>,
R: diesel::expression::ValidGrouping<__GroupByClause>,
<L as
diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate: diesel::expression::MixedAggregates<<R
as
diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate>
{
type IsAggregate =
<<L as
diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate
as
diesel::expression::MixedAggregates<<R as
diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate>>::Output;
}
};ValidGrouping)]
679pub struct Concat<L, R> {
680 pub(crate) left: L,
682 pub(crate) right: R,
684}
685
686impl<L, R> Concat<L, R> {
687 pub(crate) fn new(left: L, right: R) -> Self {
688 Self { left, right }
689 }
690}
691
692impl<L, R, ST> crate::expression::Expression for Concat<L, R>
693where
694 L: crate::expression::Expression<SqlType = ST>,
695 R: crate::expression::Expression<SqlType = ST>,
696 ST: SqlType + TypedExpressionType,
697{
698 type SqlType = ST;
699}
700
701impl<L, R, QS> crate::expression::SelectableExpression<QS> for Concat<L, R>
where Concat<L, R>: crate::expression::AppearsOnTable<QS>,
L: crate::expression::SelectableExpression<QS>,
R: crate::expression::SelectableExpression<QS> {}
impl<L, R, QS> crate::expression::AppearsOnTable<QS> for Concat<L, R> where
Concat<L, R>: crate::expression::Expression,
L: crate::expression::AppearsOnTable<QS>,
R: crate::expression::AppearsOnTable<QS> {}impl_selectable_expression!(Concat<L, R>);
702
703impl<L, R, DB> QueryFragment<DB> for Concat<L, R>
704where
705 DB: Backend,
706 Self: QueryFragment<DB, DB::ConcatClause>,
707{
708 fn walk_ast<'b>(
709 &'b self,
710 pass: crate::query_builder::AstPass<'_, 'b, DB>,
711 ) -> crate::result::QueryResult<()> {
712 <Self as QueryFragment<DB, DB::ConcatClause>>::walk_ast(self, pass)
713 }
714}
715
716impl<L, R, DB> QueryFragment<DB, sql_dialect::concat_clause::ConcatWithPipesClause> for Concat<L, R>
717where
718 L: QueryFragment<DB>,
719 R: QueryFragment<DB>,
720 DB: Backend + SqlDialect<ConcatClause = sql_dialect::concat_clause::ConcatWithPipesClause>,
721{
722 fn walk_ast<'b>(
723 &'b self,
724 mut out: crate::query_builder::AstPass<'_, 'b, DB>,
725 ) -> crate::result::QueryResult<()> {
726 out.push_sql("(");
729 self.left.walk_ast(out.reborrow())?;
730 out.push_sql(" || ");
731 self.right.walk_ast(out.reborrow())?;
732 out.push_sql(")");
733 Ok(())
734 }
735}
736
737#[derive(
739 #[automatically_derived]
impl<T: ::core::fmt::Debug, U: ::core::fmt::Debug> ::core::fmt::Debug for
Like<T, U> {
#[inline]
fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
::core::fmt::Formatter::debug_struct_field2_finish(f, "Like", "left",
&self.left, "right", &&self.right)
}
}Debug,
740 #[automatically_derived]
impl<T: ::core::clone::Clone, U: ::core::clone::Clone> ::core::clone::Clone
for Like<T, U> {
#[inline]
fn clone(&self) -> Like<T, U> {
Like {
left: ::core::clone::Clone::clone(&self.left),
right: ::core::clone::Clone::clone(&self.right),
}
}
}Clone,
741 #[automatically_derived]
impl<T: ::core::marker::Copy, U: ::core::marker::Copy> ::core::marker::Copy
for Like<T, U> {
}Copy,
742 const _: () =
{
use diesel;
#[allow(non_camel_case_types)]
impl<T: diesel::query_builder::QueryId,
U: diesel::query_builder::QueryId> diesel::query_builder::QueryId
for Like<T, U> {
type QueryId =
Like<<T as diesel::query_builder::QueryId>::QueryId,
<U as diesel::query_builder::QueryId>::QueryId>;
const HAS_STATIC_QUERY_ID: bool =
<T as diesel::query_builder::QueryId>::HAS_STATIC_QUERY_ID &&
<U as diesel::query_builder::QueryId>::HAS_STATIC_QUERY_ID
&& true;
const IS_WINDOW_FUNCTION: bool =
<T as diesel::query_builder::QueryId>::IS_WINDOW_FUNCTION ||
<U as diesel::query_builder::QueryId>::IS_WINDOW_FUNCTION ||
false;
}
};crate::query_builder::QueryId,
743 const _: () =
{
use diesel;
use diesel::internal::derives::numeric_ops as ops;
use diesel::expression::{Expression, AsExpression};
use diesel::sql_types::ops::{Add, Sub, Mul, Div};
use diesel::sql_types::{SqlType, SingleValue};
impl<T, U, __Rhs> ::core::ops::Add<__Rhs> for Like<T, U> where
Self: Expression, Self: Expression,
<Self as Expression>::SqlType: Add,
<<Self as Expression>::SqlType as Add>::Rhs: SqlType +
SingleValue,
__Rhs: AsExpression<<<Self as Expression>::SqlType as Add>::Rhs> {
type Output = ops::Add<Self, __Rhs::Expression>;
fn add(self, rhs: __Rhs) -> Self::Output {
ops::Add::new(self, rhs.as_expression())
}
}
impl<T, U, __Rhs> ::core::ops::Sub<__Rhs> for Like<T, U> where
Self: Expression, Self: Expression,
<Self as Expression>::SqlType: Sub,
<<Self as Expression>::SqlType as Sub>::Rhs: SqlType +
SingleValue,
__Rhs: AsExpression<<<Self as Expression>::SqlType as Sub>::Rhs> {
type Output = ops::Sub<Self, __Rhs::Expression>;
fn sub(self, rhs: __Rhs) -> Self::Output {
ops::Sub::new(self, rhs.as_expression())
}
}
impl<T, U, __Rhs> ::core::ops::Mul<__Rhs> for Like<T, U> where
Self: Expression, Self: Expression,
<Self as Expression>::SqlType: Mul,
<<Self as Expression>::SqlType as Mul>::Rhs: SqlType +
SingleValue,
__Rhs: AsExpression<<<Self as Expression>::SqlType as Mul>::Rhs> {
type Output = ops::Mul<Self, __Rhs::Expression>;
fn mul(self, rhs: __Rhs) -> Self::Output {
ops::Mul::new(self, rhs.as_expression())
}
}
impl<T, U, __Rhs> ::core::ops::Div<__Rhs> for Like<T, U> where
Self: Expression, Self: Expression,
<Self as Expression>::SqlType: Div,
<<Self as Expression>::SqlType as Div>::Rhs: SqlType +
SingleValue,
__Rhs: AsExpression<<<Self as Expression>::SqlType as Div>::Rhs> {
type Output = ops::Div<Self, __Rhs::Expression>;
fn div(self, rhs: __Rhs) -> Self::Output {
ops::Div::new(self, rhs.as_expression())
}
}
};crate::sql_types::DieselNumericOps,
744 const _: () =
{
use diesel;
impl<T, U, __GroupByClause>
diesel::expression::ValidGrouping<__GroupByClause> for Like<T, U>
where T: diesel::expression::ValidGrouping<__GroupByClause>,
U: diesel::expression::ValidGrouping<__GroupByClause>,
<T as
diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate: diesel::expression::MixedAggregates<<U
as
diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate>
{
type IsAggregate =
<<T as
diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate
as
diesel::expression::MixedAggregates<<U as
diesel::expression::ValidGrouping<__GroupByClause>>::IsAggregate>>::Output;
}
};crate::expression::ValidGrouping,
745)]
746#[doc(hidden)]
747pub struct Like<T, U> {
748 pub(crate) left: T,
749 pub(crate) right: U,
750}
751
752impl<T, U> Like<T, U> {
753 pub(crate) fn new(left: T, right: U) -> Self {
754 Like { left, right }
755 }
756}
757
758impl<T, U, QS> crate::expression::SelectableExpression<QS> for Like<T, U>
759where
760 Like<T, U>: crate::expression::AppearsOnTable<QS>,
761 T: crate::expression::SelectableExpression<QS>,
762 U: crate::expression::SelectableExpression<QS>,
763{
764}
765
766impl<T, U, QS> crate::expression::AppearsOnTable<QS> for Like<T, U>
767where
768 Like<T, U>: crate::expression::Expression,
769 T: crate::expression::AppearsOnTable<QS>,
770 U: crate::expression::AppearsOnTable<QS>,
771{
772}
773
774impl<T, U> crate::expression::Expression for Like<T, U>
775where
776 T: crate::expression::Expression,
777 U: crate::expression::Expression,
778 <T as crate::expression::Expression>::SqlType: crate::sql_types::SqlType,
779 <U as crate::expression::Expression>::SqlType: crate::sql_types::SqlType,
780 crate::sql_types::is_nullable::IsSqlTypeNullable<<T as crate::expression::Expression>::SqlType>:
781 crate::sql_types::OneIsNullable<
782 crate::sql_types::is_nullable::IsSqlTypeNullable<
783 <U as crate::expression::Expression>::SqlType,
784 >,
785 >,
786 crate::sql_types::is_nullable::IsOneNullable<
787 <T as crate::expression::Expression>::SqlType,
788 <U as crate::expression::Expression>::SqlType,
789 >: crate::sql_types::MaybeNullableType<crate::sql_types::Bool>,
790{
791 type SqlType = crate::sql_types::is_nullable::MaybeNullable<
792 crate::sql_types::is_nullable::IsOneNullable<
793 <T as crate::expression::Expression>::SqlType,
794 <U as crate::expression::Expression>::SqlType,
795 >,
796 crate::sql_types::Bool,
797 >;
798}
799
800impl<T, U, DB> crate::query_builder::QueryFragment<DB> for Like<T, U>
801where
802 T: crate::query_builder::QueryFragment<DB> + crate::Expression,
803 U: crate::query_builder::QueryFragment<DB>,
804 DB: crate::backend::Backend,
805 DB: LikeIsAllowedForType<T::SqlType>,
806{
807 fn walk_ast<'b>(
808 &'b self,
809 mut out: crate::query_builder::AstPass<'_, 'b, DB>,
810 ) -> crate::result::QueryResult<()> {
811 (self.left.walk_ast(out.reborrow())?);
812 (out.push_sql(" LIKE "));
813 (self.right.walk_ast(out.reborrow())?);
814 Ok(())
815 }
816}
817
818impl<S, T, U> crate::internal::operators_macro::FieldAliasMapper<S> for Like<T, U>
819where
820 S: crate::query_source::AliasSource,
821 T: crate::internal::operators_macro::FieldAliasMapper<S>,
822 U: crate::internal::operators_macro::FieldAliasMapper<S>,
823{
824 type Out = Like<
825 <T as crate::internal::operators_macro::FieldAliasMapper<S>>::Out,
826 <U as crate::internal::operators_macro::FieldAliasMapper<S>>::Out,
827 >;
828 fn map(self, alias: &crate::query_source::Alias<S>) -> Self::Out {
829 Like {
830 left: self.left.map(alias),
831 right: self.right.map(alias),
832 }
833 }
834}
835
836#[diagnostic::on_unimplemented(
837 message = "cannot use the `LIKE` operator with expressions of the type `{ST}` for the backend `{Self}`",
838 note = "expressions of the type `diesel::sql_types::Text` and `diesel::sql_types::Nullable<Text>` are \n\
839 allowed for all backends"
840)]
841#[cfg_attr(
842 feature = "postgres_backend",
843 diagnostic::on_unimplemented(
844 note = "expressions of the type `diesel::sql_types::Binary` and `diesel::sql_types::Nullable<Binary>` are \n\
845 allowed for the PostgreSQL backend"
846 )
847)]
848pub trait LikeIsAllowedForType<ST>: Backend {}
849
850impl<DB> LikeIsAllowedForType<crate::sql_types::Text> for DB where DB: Backend {}
851
852#[cfg(feature = "postgres_backend")]
853impl LikeIsAllowedForType<crate::pg::sql_types::Citext> for crate::pg::Pg {}
854
855impl<T, DB> LikeIsAllowedForType<crate::sql_types::Nullable<T>> for DB where
856 DB: Backend + LikeIsAllowedForType<T>
857{
858}
859
860#[derive(#[automatically_derived]
impl<T: ::core::fmt::Debug, C: ::core::fmt::Debug> ::core::fmt::Debug for
Collate<T, C> {
#[inline]
fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
::core::fmt::Formatter::debug_struct_field2_finish(f, "Collate",
"expr", &self.expr, "collation", &&self.collation)
}
}Debug, #[automatically_derived]
impl<T: ::core::clone::Clone, C: ::core::clone::Clone> ::core::clone::Clone
for Collate<T, C> {
#[inline]
fn clone(&self) -> Collate<T, C> {
Collate {
expr: ::core::clone::Clone::clone(&self.expr),
collation: ::core::clone::Clone::clone(&self.collation),
}
}
}Clone, const _: () =
{
use diesel;
use diesel::internal::derives::numeric_ops as ops;
use diesel::expression::{Expression, AsExpression};
use diesel::sql_types::ops::{Add, Sub, Mul, Div};
use diesel::sql_types::{SqlType, SingleValue};
impl<T, C, __Rhs> ::core::ops::Add<__Rhs> for Collate<T, C> where
Self: Expression, Self: Expression,
<Self as Expression>::SqlType: Add,
<<Self as Expression>::SqlType as Add>::Rhs: SqlType +
SingleValue,
__Rhs: AsExpression<<<Self as Expression>::SqlType as Add>::Rhs> {
type Output = ops::Add<Self, __Rhs::Expression>;
fn add(self, rhs: __Rhs) -> Self::Output {
ops::Add::new(self, rhs.as_expression())
}
}
impl<T, C, __Rhs> ::core::ops::Sub<__Rhs> for Collate<T, C> where
Self: Expression, Self: Expression,
<Self as Expression>::SqlType: Sub,
<<Self as Expression>::SqlType as Sub>::Rhs: SqlType +
SingleValue,
__Rhs: AsExpression<<<Self as Expression>::SqlType as Sub>::Rhs> {
type Output = ops::Sub<Self, __Rhs::Expression>;
fn sub(self, rhs: __Rhs) -> Self::Output {
ops::Sub::new(self, rhs.as_expression())
}
}
impl<T, C, __Rhs> ::core::ops::Mul<__Rhs> for Collate<T, C> where
Self: Expression, Self: Expression,
<Self as Expression>::SqlType: Mul,
<<Self as Expression>::SqlType as Mul>::Rhs: SqlType +
SingleValue,
__Rhs: AsExpression<<<Self as Expression>::SqlType as Mul>::Rhs> {
type Output = ops::Mul<Self, __Rhs::Expression>;
fn mul(self, rhs: __Rhs) -> Self::Output {
ops::Mul::new(self, rhs.as_expression())
}
}
impl<T, C, __Rhs> ::core::ops::Div<__Rhs> for Collate<T, C> where
Self: Expression, Self: Expression,
<Self as Expression>::SqlType: Div,
<<Self as Expression>::SqlType as Div>::Rhs: SqlType +
SingleValue,
__Rhs: AsExpression<<<Self as Expression>::SqlType as Div>::Rhs> {
type Output = ops::Div<Self, __Rhs::Expression>;
fn div(self, rhs: __Rhs) -> Self::Output {
ops::Div::new(self, rhs.as_expression())
}
}
};DieselNumericOps)]
862pub struct Collate<T, C> {
863 pub(crate) expr: T,
864 pub(crate) collation: C,
865}
866
867impl<T, C> Collate<T, C> {
868 pub fn new(expr: T, collation: C) -> Self {
870 Collate { expr, collation }
871 }
872}
873
874impl<T, C> crate::expression::Expression for Collate<T, C>
875where
876 T: crate::expression::Expression,
877{
878 type SqlType = T::SqlType;
879}
880
881impl<T, C, GB> crate::expression::ValidGrouping<GB> for Collate<T, C>
882where
883 T: crate::expression::ValidGrouping<GB>,
884{
885 type IsAggregate = T::IsAggregate;
886}
887
888impl<T, C, DB> crate::query_builder::QueryFragment<DB> for Collate<T, C>
889where
890 DB: crate::backend::Backend,
891 T: crate::query_builder::QueryFragment<DB>,
892 C: crate::query_builder::QueryFragment<DB>,
893{
894 fn walk_ast<'b>(
895 &'b self,
896 mut out: crate::query_builder::AstPass<'_, 'b, DB>,
897 ) -> crate::result::QueryResult<()> {
898 self.expr.walk_ast(out.reborrow())?;
899 out.push_sql(" COLLATE ");
900 self.collation.walk_ast(out.reborrow())?;
901 Ok(())
902 }
903}
904
905impl<T, C> crate::query_builder::QueryId for Collate<T, C>
906where
907 T: crate::query_builder::QueryId,
908 C: crate::query_builder::QueryId,
909{
910 type QueryId = (T::QueryId, C::QueryId);
911 const HAS_STATIC_QUERY_ID: bool = T::HAS_STATIC_QUERY_ID && C::HAS_STATIC_QUERY_ID;
912}
913
914impl<T, C, QS> crate::expression::SelectableExpression<QS> for Collate<T, C>
915where
916 T: crate::expression::SelectableExpression<QS>,
917 Collate<T, C>: crate::expression::AppearsOnTable<QS>,
918{
919}
920
921impl<T, C, QS> crate::expression::AppearsOnTable<QS> for Collate<T, C>
922where
923 T: crate::expression::AppearsOnTable<QS>,
924 Collate<T, C>: crate::expression::Expression,
925{
926}
927
928impl<S, T, C> crate::internal::operators_macro::FieldAliasMapper<S> for Collate<T, C>
929where
930 S: crate::query_source::AliasSource,
931 T: crate::internal::operators_macro::FieldAliasMapper<S>,
932 C: Copy,
933{
934 type Out = Collate<<T as crate::internal::operators_macro::FieldAliasMapper<S>>::Out, C>;
935
936 fn map(self, alias: &crate::query_source::Alias<S>) -> Self::Out {
937 Collate {
938 expr: self.expr.map(alias),
939 collation: self.collation,
940 }
941 }
942}