use crate::dialect::DialectTypes;
use crate::sql::{SQL, Token};
use crate::traits::SQLParam;
use crate::types::{Compatible, DataType, Textual};
use super::{AggOr, AggregateKind, Expr, NonNull, SQLExpr};
fn binary_op<'a, V, L, R>(left: L, operator: Token, right: R) -> SQL<'a, V>
where
V: SQLParam + 'a,
L: Expr<'a, V>,
R: ComparisonOperand<'a, V, L>,
L::SQLType: Compatible<<R as ComparisonOperand<'a, V, L>>::SQLType>,
{
let left_sql = operand_sql(left);
let right_sql = ComparisonOperand::into_comparison_sql(right);
left_sql.push(operator).append(right_sql)
}
#[inline]
fn operand_sql<'a, V, T>(value: T) -> SQL<'a, V>
where
V: SQLParam + 'a,
T: Expr<'a, V>,
{
value.into_expr_sql()
}
pub trait ComparisonOperand<'a, V, L>: Sized
where
V: SQLParam + 'a,
L: Expr<'a, V>,
{
type SQLType: DataType;
type Aggregate: AggregateKind;
fn into_comparison_sql(self) -> SQL<'a, V>;
}
impl<'a, V, L, R> ComparisonOperand<'a, V, L> for R
where
V: SQLParam + 'a,
L: Expr<'a, V>,
R: Expr<'a, V>,
L::SQLType: Compatible<R::SQLType>,
{
type SQLType = R::SQLType;
type Aggregate = R::Aggregate;
fn into_comparison_sql(self) -> SQL<'a, V> {
self.into_expr_sql()
}
}
#[allow(clippy::type_complexity)]
pub fn eq<'a, V, L, R>(
left: L,
right: R,
) -> SQLExpr<
'a,
V,
<V::DialectMarker as DialectTypes>::Bool,
NonNull,
<L::Aggregate as AggOr<<R as ComparisonOperand<'a, V, L>>::Aggregate>>::Output,
>
where
V: SQLParam + 'a,
L: Expr<'a, V>,
R: ComparisonOperand<'a, V, L>,
L::SQLType: Compatible<<R as ComparisonOperand<'a, V, L>>::SQLType>,
L::Aggregate: AggOr<<R as ComparisonOperand<'a, V, L>>::Aggregate>,
{
SQLExpr::new(binary_op(left, Token::EQ, right))
}
#[allow(clippy::type_complexity)]
pub fn ne<'a, V, L, R>(
left: L,
right: R,
) -> SQLExpr<
'a,
V,
<V::DialectMarker as DialectTypes>::Bool,
NonNull,
<L::Aggregate as AggOr<<R as ComparisonOperand<'a, V, L>>::Aggregate>>::Output,
>
where
V: SQLParam + 'a,
L: Expr<'a, V>,
R: ComparisonOperand<'a, V, L>,
L::SQLType: Compatible<<R as ComparisonOperand<'a, V, L>>::SQLType>,
L::Aggregate: AggOr<<R as ComparisonOperand<'a, V, L>>::Aggregate>,
{
SQLExpr::new(binary_op(left, Token::NE, right))
}
#[allow(clippy::type_complexity)]
pub fn neq<'a, V, L, R>(
left: L,
right: R,
) -> SQLExpr<
'a,
V,
<V::DialectMarker as DialectTypes>::Bool,
NonNull,
<L::Aggregate as AggOr<<R as ComparisonOperand<'a, V, L>>::Aggregate>>::Output,
>
where
V: SQLParam + 'a,
L: Expr<'a, V>,
R: ComparisonOperand<'a, V, L>,
L::SQLType: Compatible<<R as ComparisonOperand<'a, V, L>>::SQLType>,
L::Aggregate: AggOr<<R as ComparisonOperand<'a, V, L>>::Aggregate>,
{
ne(left, right)
}
#[allow(clippy::type_complexity)]
pub fn gt<'a, V, L, R>(
left: L,
right: R,
) -> SQLExpr<
'a,
V,
<V::DialectMarker as DialectTypes>::Bool,
NonNull,
<L::Aggregate as AggOr<<R as ComparisonOperand<'a, V, L>>::Aggregate>>::Output,
>
where
V: SQLParam + 'a,
L: Expr<'a, V>,
R: ComparisonOperand<'a, V, L>,
L::SQLType: Compatible<<R as ComparisonOperand<'a, V, L>>::SQLType>,
L::Aggregate: AggOr<<R as ComparisonOperand<'a, V, L>>::Aggregate>,
{
SQLExpr::new(binary_op(left, Token::GT, right))
}
#[allow(clippy::type_complexity)]
pub fn gte<'a, V, L, R>(
left: L,
right: R,
) -> SQLExpr<
'a,
V,
<V::DialectMarker as DialectTypes>::Bool,
NonNull,
<L::Aggregate as AggOr<<R as ComparisonOperand<'a, V, L>>::Aggregate>>::Output,
>
where
V: SQLParam + 'a,
L: Expr<'a, V>,
R: ComparisonOperand<'a, V, L>,
L::SQLType: Compatible<<R as ComparisonOperand<'a, V, L>>::SQLType>,
L::Aggregate: AggOr<<R as ComparisonOperand<'a, V, L>>::Aggregate>,
{
SQLExpr::new(binary_op(left, Token::GE, right))
}
#[allow(clippy::type_complexity)]
pub fn lt<'a, V, L, R>(
left: L,
right: R,
) -> SQLExpr<
'a,
V,
<V::DialectMarker as DialectTypes>::Bool,
NonNull,
<L::Aggregate as AggOr<<R as ComparisonOperand<'a, V, L>>::Aggregate>>::Output,
>
where
V: SQLParam + 'a,
L: Expr<'a, V>,
R: ComparisonOperand<'a, V, L>,
L::SQLType: Compatible<<R as ComparisonOperand<'a, V, L>>::SQLType>,
L::Aggregate: AggOr<<R as ComparisonOperand<'a, V, L>>::Aggregate>,
{
SQLExpr::new(binary_op(left, Token::LT, right))
}
#[allow(clippy::type_complexity)]
pub fn lte<'a, V, L, R>(
left: L,
right: R,
) -> SQLExpr<
'a,
V,
<V::DialectMarker as DialectTypes>::Bool,
NonNull,
<L::Aggregate as AggOr<<R as ComparisonOperand<'a, V, L>>::Aggregate>>::Output,
>
where
V: SQLParam + 'a,
L: Expr<'a, V>,
R: ComparisonOperand<'a, V, L>,
L::SQLType: Compatible<<R as ComparisonOperand<'a, V, L>>::SQLType>,
L::Aggregate: AggOr<<R as ComparisonOperand<'a, V, L>>::Aggregate>,
{
SQLExpr::new(binary_op(left, Token::LE, right))
}
#[allow(clippy::type_complexity)]
pub fn like<'a, V, L, R>(
left: L,
pattern: R,
) -> SQLExpr<
'a,
V,
<V::DialectMarker as DialectTypes>::Bool,
NonNull,
<L::Aggregate as AggOr<<R as ComparisonOperand<'a, V, L>>::Aggregate>>::Output,
>
where
V: SQLParam + 'a,
L: Expr<'a, V>,
R: ComparisonOperand<'a, V, L>,
L::SQLType: Compatible<<R as ComparisonOperand<'a, V, L>>::SQLType>,
L::SQLType: Textual,
<R as ComparisonOperand<'a, V, L>>::SQLType: Textual,
L::Aggregate: AggOr<<R as ComparisonOperand<'a, V, L>>::Aggregate>,
{
SQLExpr::new(
operand_sql(left)
.push(Token::LIKE)
.append(ComparisonOperand::into_comparison_sql(pattern)),
)
}
#[allow(clippy::type_complexity)]
pub fn not_like<'a, V, L, R>(
left: L,
pattern: R,
) -> SQLExpr<
'a,
V,
<V::DialectMarker as DialectTypes>::Bool,
NonNull,
<L::Aggregate as AggOr<<R as ComparisonOperand<'a, V, L>>::Aggregate>>::Output,
>
where
V: SQLParam + 'a,
L: Expr<'a, V>,
R: ComparisonOperand<'a, V, L>,
L::SQLType: Compatible<<R as ComparisonOperand<'a, V, L>>::SQLType>,
L::SQLType: Textual,
<R as ComparisonOperand<'a, V, L>>::SQLType: Textual,
L::Aggregate: AggOr<<R as ComparisonOperand<'a, V, L>>::Aggregate>,
{
SQLExpr::new(
operand_sql(left)
.push(Token::NOT)
.push(Token::LIKE)
.append(ComparisonOperand::into_comparison_sql(pattern)),
)
}
#[allow(clippy::type_complexity)]
pub fn between<'a, V, E, L, H>(
expr: E,
low: L,
high: H,
) -> SQLExpr<
'a,
V,
<V::DialectMarker as DialectTypes>::Bool,
NonNull,
<<E::Aggregate as AggOr<<L as ComparisonOperand<'a, V, E>>::Aggregate>>::Output as AggOr<
<H as ComparisonOperand<'a, V, E>>::Aggregate,
>>::Output,
>
where
V: SQLParam + 'a,
E: Expr<'a, V>,
L: ComparisonOperand<'a, V, E>,
H: ComparisonOperand<'a, V, E>,
E::SQLType: Compatible<<L as ComparisonOperand<'a, V, E>>::SQLType>,
E::SQLType: Compatible<<H as ComparisonOperand<'a, V, E>>::SQLType>,
E::Aggregate: AggOr<<L as ComparisonOperand<'a, V, E>>::Aggregate>,
<E::Aggregate as AggOr<<L as ComparisonOperand<'a, V, E>>::Aggregate>>::Output:
AggOr<<H as ComparisonOperand<'a, V, E>>::Aggregate>,
{
SQLExpr::new(
SQL::from(Token::LPAREN)
.append(operand_sql(expr))
.push(Token::BETWEEN)
.append(ComparisonOperand::into_comparison_sql(low))
.push(Token::AND)
.append(ComparisonOperand::into_comparison_sql(high))
.push(Token::RPAREN),
)
}
#[allow(clippy::type_complexity)]
pub fn not_between<'a, V, E, L, H>(
expr: E,
low: L,
high: H,
) -> SQLExpr<
'a,
V,
<V::DialectMarker as DialectTypes>::Bool,
NonNull,
<<E::Aggregate as AggOr<<L as ComparisonOperand<'a, V, E>>::Aggregate>>::Output as AggOr<
<H as ComparisonOperand<'a, V, E>>::Aggregate,
>>::Output,
>
where
V: SQLParam + 'a,
E: Expr<'a, V>,
L: ComparisonOperand<'a, V, E>,
H: ComparisonOperand<'a, V, E>,
E::SQLType: Compatible<<L as ComparisonOperand<'a, V, E>>::SQLType>,
E::SQLType: Compatible<<H as ComparisonOperand<'a, V, E>>::SQLType>,
E::Aggregate: AggOr<<L as ComparisonOperand<'a, V, E>>::Aggregate>,
<E::Aggregate as AggOr<<L as ComparisonOperand<'a, V, E>>::Aggregate>>::Output:
AggOr<<H as ComparisonOperand<'a, V, E>>::Aggregate>,
{
SQLExpr::new(
SQL::from(Token::LPAREN)
.append(operand_sql(expr))
.push(Token::NOT)
.push(Token::BETWEEN)
.append(ComparisonOperand::into_comparison_sql(low))
.push(Token::AND)
.append(ComparisonOperand::into_comparison_sql(high))
.push(Token::RPAREN),
)
}
pub fn is_null<'a, V, E>(
expr: E,
) -> SQLExpr<'a, V, <V::DialectMarker as DialectTypes>::Bool, NonNull, E::Aggregate>
where
V: SQLParam + 'a,
E: Expr<'a, V>,
{
SQLExpr::new(operand_sql(expr).push(Token::IS).push(Token::NULL))
}
pub fn is_not_null<'a, V, E>(
expr: E,
) -> SQLExpr<'a, V, <V::DialectMarker as DialectTypes>::Bool, NonNull, E::Aggregate>
where
V: SQLParam + 'a,
E: Expr<'a, V>,
{
SQLExpr::new(
operand_sql(expr)
.push(Token::IS)
.push(Token::NOT)
.push(Token::NULL),
)
}
#[allow(clippy::type_complexity)]
pub fn is_distinct_from<'a, V, L, R>(
left: L,
right: R,
) -> SQLExpr<
'a,
V,
<V::DialectMarker as DialectTypes>::Bool,
NonNull,
<L::Aggregate as AggOr<<R as ComparisonOperand<'a, V, L>>::Aggregate>>::Output,
>
where
V: SQLParam + 'a,
L: Expr<'a, V>,
R: ComparisonOperand<'a, V, L>,
L::SQLType: Compatible<<R as ComparisonOperand<'a, V, L>>::SQLType>,
L::Aggregate: AggOr<<R as ComparisonOperand<'a, V, L>>::Aggregate>,
{
SQLExpr::new(
operand_sql(left)
.push(Token::IS)
.push(Token::DISTINCT)
.push(Token::FROM)
.append(ComparisonOperand::into_comparison_sql(right)),
)
}
#[allow(clippy::type_complexity)]
pub fn is_not_distinct_from<'a, V, L, R>(
left: L,
right: R,
) -> SQLExpr<
'a,
V,
<V::DialectMarker as DialectTypes>::Bool,
NonNull,
<L::Aggregate as AggOr<<R as ComparisonOperand<'a, V, L>>::Aggregate>>::Output,
>
where
V: SQLParam + 'a,
L: Expr<'a, V>,
R: ComparisonOperand<'a, V, L>,
L::SQLType: Compatible<<R as ComparisonOperand<'a, V, L>>::SQLType>,
L::Aggregate: AggOr<<R as ComparisonOperand<'a, V, L>>::Aggregate>,
{
SQLExpr::new(
operand_sql(left)
.push(Token::IS)
.push(Token::NOT)
.push(Token::DISTINCT)
.push(Token::FROM)
.append(ComparisonOperand::into_comparison_sql(right)),
)
}
pub fn is_true<'a, V, E>(
expr: E,
) -> SQLExpr<'a, V, <V::DialectMarker as DialectTypes>::Bool, NonNull, E::Aggregate>
where
V: SQLParam + 'a,
E: Expr<'a, V>,
{
SQLExpr::new(operand_sql(expr).push(Token::IS).append(SQL::raw("TRUE")))
}
pub fn is_false<'a, V, E>(
expr: E,
) -> SQLExpr<'a, V, <V::DialectMarker as DialectTypes>::Bool, NonNull, E::Aggregate>
where
V: SQLParam + 'a,
E: Expr<'a, V>,
{
SQLExpr::new(operand_sql(expr).push(Token::IS).append(SQL::raw("FALSE")))
}
pub trait ExprExt<'a, V: SQLParam>: Expr<'a, V> + Sized {
#[allow(clippy::type_complexity)]
fn eq<R>(
self,
other: R,
) -> SQLExpr<
'a,
V,
<V::DialectMarker as DialectTypes>::Bool,
NonNull,
<Self::Aggregate as AggOr<<R as ComparisonOperand<'a, V, Self>>::Aggregate>>::Output,
>
where
R: ComparisonOperand<'a, V, Self>,
Self::SQLType: Compatible<<R as ComparisonOperand<'a, V, Self>>::SQLType>,
Self::Aggregate: AggOr<<R as ComparisonOperand<'a, V, Self>>::Aggregate>,
{
eq(self, other)
}
#[allow(clippy::type_complexity)]
fn ne<R>(
self,
other: R,
) -> SQLExpr<
'a,
V,
<V::DialectMarker as DialectTypes>::Bool,
NonNull,
<Self::Aggregate as AggOr<<R as ComparisonOperand<'a, V, Self>>::Aggregate>>::Output,
>
where
R: ComparisonOperand<'a, V, Self>,
Self::SQLType: Compatible<<R as ComparisonOperand<'a, V, Self>>::SQLType>,
Self::Aggregate: AggOr<<R as ComparisonOperand<'a, V, Self>>::Aggregate>,
{
ne(self, other)
}
#[allow(clippy::type_complexity)]
fn gt<R>(
self,
other: R,
) -> SQLExpr<
'a,
V,
<V::DialectMarker as DialectTypes>::Bool,
NonNull,
<Self::Aggregate as AggOr<<R as ComparisonOperand<'a, V, Self>>::Aggregate>>::Output,
>
where
R: ComparisonOperand<'a, V, Self>,
Self::SQLType: Compatible<<R as ComparisonOperand<'a, V, Self>>::SQLType>,
Self::Aggregate: AggOr<<R as ComparisonOperand<'a, V, Self>>::Aggregate>,
{
gt(self, other)
}
#[allow(clippy::type_complexity)]
fn ge<R>(
self,
other: R,
) -> SQLExpr<
'a,
V,
<V::DialectMarker as DialectTypes>::Bool,
NonNull,
<Self::Aggregate as AggOr<<R as ComparisonOperand<'a, V, Self>>::Aggregate>>::Output,
>
where
R: ComparisonOperand<'a, V, Self>,
Self::SQLType: Compatible<<R as ComparisonOperand<'a, V, Self>>::SQLType>,
Self::Aggregate: AggOr<<R as ComparisonOperand<'a, V, Self>>::Aggregate>,
{
gte(self, other)
}
#[allow(clippy::type_complexity)]
fn lt<R>(
self,
other: R,
) -> SQLExpr<
'a,
V,
<V::DialectMarker as DialectTypes>::Bool,
NonNull,
<Self::Aggregate as AggOr<<R as ComparisonOperand<'a, V, Self>>::Aggregate>>::Output,
>
where
R: ComparisonOperand<'a, V, Self>,
Self::SQLType: Compatible<<R as ComparisonOperand<'a, V, Self>>::SQLType>,
Self::Aggregate: AggOr<<R as ComparisonOperand<'a, V, Self>>::Aggregate>,
{
lt(self, other)
}
#[allow(clippy::type_complexity)]
fn le<R>(
self,
other: R,
) -> SQLExpr<
'a,
V,
<V::DialectMarker as DialectTypes>::Bool,
NonNull,
<Self::Aggregate as AggOr<<R as ComparisonOperand<'a, V, Self>>::Aggregate>>::Output,
>
where
R: ComparisonOperand<'a, V, Self>,
Self::SQLType: Compatible<<R as ComparisonOperand<'a, V, Self>>::SQLType>,
Self::Aggregate: AggOr<<R as ComparisonOperand<'a, V, Self>>::Aggregate>,
{
lte(self, other)
}
#[allow(clippy::type_complexity)]
fn like<R>(
self,
pattern: R,
) -> SQLExpr<
'a,
V,
<V::DialectMarker as DialectTypes>::Bool,
NonNull,
<Self::Aggregate as AggOr<<R as ComparisonOperand<'a, V, Self>>::Aggregate>>::Output,
>
where
R: ComparisonOperand<'a, V, Self>,
Self::SQLType: Compatible<<R as ComparisonOperand<'a, V, Self>>::SQLType>,
Self::SQLType: Textual,
<R as ComparisonOperand<'a, V, Self>>::SQLType: Textual,
Self::Aggregate: AggOr<<R as ComparisonOperand<'a, V, Self>>::Aggregate>,
{
like(self, pattern)
}
#[allow(clippy::type_complexity)]
fn not_like<R>(
self,
pattern: R,
) -> SQLExpr<
'a,
V,
<V::DialectMarker as DialectTypes>::Bool,
NonNull,
<Self::Aggregate as AggOr<<R as ComparisonOperand<'a, V, Self>>::Aggregate>>::Output,
>
where
R: ComparisonOperand<'a, V, Self>,
Self::SQLType: Compatible<<R as ComparisonOperand<'a, V, Self>>::SQLType>,
Self::SQLType: Textual,
<R as ComparisonOperand<'a, V, Self>>::SQLType: Textual,
Self::Aggregate: AggOr<<R as ComparisonOperand<'a, V, Self>>::Aggregate>,
{
not_like(self, pattern)
}
#[allow(clippy::wrong_self_convention)]
fn is_null(
self,
) -> SQLExpr<'a, V, <V::DialectMarker as DialectTypes>::Bool, NonNull, Self::Aggregate> {
is_null(self)
}
#[allow(clippy::wrong_self_convention)]
fn is_not_null(
self,
) -> SQLExpr<'a, V, <V::DialectMarker as DialectTypes>::Bool, NonNull, Self::Aggregate> {
is_not_null(self)
}
#[allow(clippy::type_complexity)]
fn between<L, H>(
self,
low: L,
high: H,
) -> SQLExpr<
'a,
V,
<V::DialectMarker as DialectTypes>::Bool,
NonNull,
<<Self::Aggregate as AggOr<
<L as ComparisonOperand<'a, V, Self>>::Aggregate,
>>::Output as AggOr<
<H as ComparisonOperand<'a, V, Self>>::Aggregate,
>>::Output,
>
where
L: ComparisonOperand<'a, V, Self>,
H: ComparisonOperand<'a, V, Self>,
Self::SQLType: Compatible<<L as ComparisonOperand<'a, V, Self>>::SQLType>,
Self::SQLType: Compatible<<H as ComparisonOperand<'a, V, Self>>::SQLType>,
Self::Aggregate:
AggOr<<L as ComparisonOperand<'a, V, Self>>::Aggregate>,
<Self::Aggregate as AggOr<
<L as ComparisonOperand<'a, V, Self>>::Aggregate,
>>::Output:
AggOr<<H as ComparisonOperand<'a, V, Self>>::Aggregate>,
{
between(self, low, high)
}
#[allow(clippy::type_complexity)]
fn not_between<L, H>(
self,
low: L,
high: H,
) -> SQLExpr<
'a,
V,
<V::DialectMarker as DialectTypes>::Bool,
NonNull,
<<Self::Aggregate as AggOr<
<L as ComparisonOperand<'a, V, Self>>::Aggregate,
>>::Output as AggOr<
<H as ComparisonOperand<'a, V, Self>>::Aggregate,
>>::Output,
>
where
L: ComparisonOperand<'a, V, Self>,
H: ComparisonOperand<'a, V, Self>,
Self::SQLType: Compatible<<L as ComparisonOperand<'a, V, Self>>::SQLType>,
Self::SQLType: Compatible<<H as ComparisonOperand<'a, V, Self>>::SQLType>,
Self::Aggregate:
AggOr<<L as ComparisonOperand<'a, V, Self>>::Aggregate>,
<Self::Aggregate as AggOr<
<L as ComparisonOperand<'a, V, Self>>::Aggregate,
>>::Output:
AggOr<<H as ComparisonOperand<'a, V, Self>>::Aggregate>,
{
not_between(self, low, high)
}
fn in_array<I, R>(
self,
values: I,
) -> SQLExpr<'a, V, <V::DialectMarker as DialectTypes>::Bool, NonNull, Self::Aggregate>
where
I: IntoIterator<Item = R>,
R: Expr<'a, V>,
Self::SQLType: Compatible<R::SQLType>,
{
crate::expr::in_array(self, values)
}
fn not_in_array<I, R>(
self,
values: I,
) -> SQLExpr<'a, V, <V::DialectMarker as DialectTypes>::Bool, NonNull, Self::Aggregate>
where
I: IntoIterator<Item = R>,
R: Expr<'a, V>,
Self::SQLType: Compatible<R::SQLType>,
{
crate::expr::not_in_array(self, values)
}
fn in_subquery<S>(
self,
subquery: S,
) -> SQLExpr<'a, V, <V::DialectMarker as DialectTypes>::Bool, NonNull, Self::Aggregate>
where
S: Expr<'a, V>,
Self::SQLType: Compatible<S::SQLType>,
{
crate::expr::in_subquery(self, subquery)
}
fn not_in_subquery<S>(
self,
subquery: S,
) -> SQLExpr<'a, V, <V::DialectMarker as DialectTypes>::Bool, NonNull, Self::Aggregate>
where
S: Expr<'a, V>,
Self::SQLType: Compatible<S::SQLType>,
{
crate::expr::not_in_subquery(self, subquery)
}
#[allow(clippy::type_complexity, clippy::wrong_self_convention)]
fn is_distinct_from<R>(
self,
other: R,
) -> SQLExpr<
'a,
V,
<V::DialectMarker as DialectTypes>::Bool,
NonNull,
<Self::Aggregate as AggOr<<R as ComparisonOperand<'a, V, Self>>::Aggregate>>::Output,
>
where
R: ComparisonOperand<'a, V, Self>,
Self::SQLType: Compatible<<R as ComparisonOperand<'a, V, Self>>::SQLType>,
Self::Aggregate: AggOr<<R as ComparisonOperand<'a, V, Self>>::Aggregate>,
{
is_distinct_from(self, other)
}
#[allow(clippy::type_complexity, clippy::wrong_self_convention)]
fn is_not_distinct_from<R>(
self,
other: R,
) -> SQLExpr<
'a,
V,
<V::DialectMarker as DialectTypes>::Bool,
NonNull,
<Self::Aggregate as AggOr<<R as ComparisonOperand<'a, V, Self>>::Aggregate>>::Output,
>
where
R: ComparisonOperand<'a, V, Self>,
Self::SQLType: Compatible<<R as ComparisonOperand<'a, V, Self>>::SQLType>,
Self::Aggregate: AggOr<<R as ComparisonOperand<'a, V, Self>>::Aggregate>,
{
is_not_distinct_from(self, other)
}
#[allow(clippy::wrong_self_convention)]
fn is_true(
self,
) -> SQLExpr<'a, V, <V::DialectMarker as DialectTypes>::Bool, NonNull, Self::Aggregate> {
is_true(self)
}
#[allow(clippy::wrong_self_convention)]
fn is_false(
self,
) -> SQLExpr<'a, V, <V::DialectMarker as DialectTypes>::Bool, NonNull, Self::Aggregate> {
is_false(self)
}
}
impl<'a, V: SQLParam, E: Expr<'a, V>> ExprExt<'a, V> for E {}