Skip to content
12 changes: 6 additions & 6 deletions src/expr/trait.rs
Original file line number Diff line number Diff line change
Expand Up @@ -920,11 +920,11 @@ pub trait ExprTrait: Sized {
/// r#"SELECT "character", "size_w", "size_h" FROM "character" WHERE "character"."character" LIKE '|_Our|_' ESCAPE '|'"#
/// );
/// ```
fn like<L>(self, like: L) -> Expr
fn like<R>(self, right: R) -> Expr
where
L: IntoLikeExpr,
R: Into<Expr>,
{
self.binary(BinOper::Like, like.into_like_expr())
self.binary(BinOper::Like, right)
}

/// Express a less than (`<`) expression.
Expand Down Expand Up @@ -1255,11 +1255,11 @@ pub trait ExprTrait: Sized {
/// r#"SELECT "character", "size_w", "size_h" FROM "character" WHERE "character"."character" NOT LIKE 'Ours''%'"#
/// );
/// ```
fn not_like<L>(self, like: L) -> Expr
fn not_like<R>(self, right: R) -> Expr
where
L: IntoLikeExpr,
R: Into<Expr>,
{
self.binary(BinOper::NotLike, like.into_like_expr())
self.binary(BinOper::NotLike, right)
}

/// Express a logical `OR` operation.
Expand Down
14 changes: 7 additions & 7 deletions src/extension/postgres/expr.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use super::PgBinOper;
use crate::{Expr, ExprTrait, IntoLikeExpr};
use crate::{Expr, ExprTrait};

/// Postgres-specific operator methods for building expressions.
pub trait PgExpr: ExprTrait {
Expand Down Expand Up @@ -140,19 +140,19 @@ pub trait PgExpr: ExprTrait {
/// r#"SELECT "character", "size_w", "size_h" FROM "character" WHERE "character"."character" ILIKE E'Ours\'%'"#
/// );
/// ```
fn ilike<L>(self, like: L) -> Expr
fn ilike<R>(self, right: R) -> Expr
where
L: IntoLikeExpr,
R: Into<Expr>,
{
self.binary(PgBinOper::ILike, like.into_like_expr())
self.binary(PgBinOper::ILike, right)
}

/// Express a `NOT ILIKE` expression
fn not_ilike<L>(self, like: L) -> Expr
fn not_ilike<R>(self, right: R) -> Expr
where
L: IntoLikeExpr,
R: Into<Expr>,
{
self.binary(PgBinOper::NotILike, like.into_like_expr())
self.binary(PgBinOper::NotILike, right)
}

/// Express a postgres retrieves JSON field as JSON value (`->`).
Expand Down
Loading