#[non_exhaustive]pub enum Expr {
Show 15 variants
Column(ColumnRef),
Tuple(Vec<Expr>),
Unary(UnOper, Box<Expr>),
FunctionCall(FunctionCall),
Binary(Box<Expr>, BinOper, Box<Expr>),
SubQuery(Option<SubQueryOper>, Box<SubQueryStatement>),
Value(Value),
Values(Vec<Value>),
Custom(Cow<'static, str>),
CustomWithExpr(Cow<'static, str>, Vec<Expr>),
Keyword(Keyword),
AsEnum(DynIden, Box<Expr>),
Case(Box<CaseStatement>),
Constant(Value),
TypeName(TypeRef),
}Expand description
An arbitrary, dynamically-typed SQL expression.
It can be used in select fields, where clauses and many other places.
More concreterly, under the hood Exprs can be:
- Rust values
- SQL identifiers
- SQL function calls
- various operators and sub-queries
If something is not supported here, look into BinOper::Custom,
Func::cust, or Expr::cust* as a
workaround, and consider reporting your issue.
Variants (Non-exhaustive)ยง
This enum is marked as non-exhaustive
Column(ColumnRef)
Tuple(Vec<Expr>)
Unary(UnOper, Box<Expr>)
FunctionCall(FunctionCall)
Binary(Box<Expr>, BinOper, Box<Expr>)
SubQuery(Option<SubQueryOper>, Box<SubQueryStatement>)
Value(Value)
Values(Vec<Value>)
Custom(Cow<'static, str>)
CustomWithExpr(Cow<'static, str>, Vec<Expr>)
Keyword(Keyword)
AsEnum(DynIden, Box<Expr>)
Case(Box<CaseStatement>)
Constant(Value)
TypeName(TypeRef)
Implementationsยง
Sourceยงimpl Expr
impl Expr
pub fn asterisk() -> Self
Asterisk]Sourcepub fn col<T>(n: T) -> Selfwhere
T: IntoColumnRef,
pub fn col<T>(n: T) -> Selfwhere
T: IntoColumnRef,
Express the target column without table prefix.
ยงExamples
use sea_query::{tests_cfg::*, *};
let query = Query::select()
.columns([Char::Character, Char::SizeW, Char::SizeH])
.from(Char::Table)
.and_where(Expr::col(Char::SizeW).eq(1))
.to_owned();
assert_eq!(
query.to_string(MysqlQueryBuilder),
r#"SELECT `character`, `size_w`, `size_h` FROM `character` WHERE `size_w` = 1"#
);
assert_eq!(
query.to_string(PostgresQueryBuilder),
r#"SELECT "character", "size_w", "size_h" FROM "character" WHERE "size_w" = 1"#
);
assert_eq!(
query.to_string(SqliteQueryBuilder),
r#"SELECT "character", "size_w", "size_h" FROM "character" WHERE "size_w" = 1"#
);use sea_query::{tests_cfg::*, *};
let query = Query::select()
.columns([Char::Character, Char::SizeW, Char::SizeH])
.from(Char::Table)
.and_where(Expr::col((Char::Table, Char::SizeW)).eq(1))
.to_owned();
assert_eq!(
query.to_string(MysqlQueryBuilder),
r#"SELECT `character`, `size_w`, `size_h` FROM `character` WHERE `character`.`size_w` = 1"#
);
assert_eq!(
query.to_string(PostgresQueryBuilder),
r#"SELECT "character", "size_w", "size_h" FROM "character" WHERE "character"."size_w" = 1"#
);
assert_eq!(
query.to_string(SqliteQueryBuilder),
r#"SELECT "character", "size_w", "size_h" FROM "character" WHERE "character"."size_w" = 1"#
);Sourcepub fn column<T>(n: T) -> Selfwhere
T: IntoColumnRef,
pub fn column<T>(n: T) -> Selfwhere
T: IntoColumnRef,
Express the target column without table prefix, returning a Expr.
ยงExamples
use sea_query::{tests_cfg::*, *};
let query = Query::select()
.columns([Char::Character, Char::SizeW, Char::SizeH])
.from(Char::Table)
.and_where(Expr::column(Char::SizeW).eq(1))
.to_owned();
assert_eq!(
query.to_string(MysqlQueryBuilder),
r#"SELECT `character`, `size_w`, `size_h` FROM `character` WHERE `size_w` = 1"#
);
assert_eq!(
query.to_string(PostgresQueryBuilder),
r#"SELECT "character", "size_w", "size_h" FROM "character" WHERE "size_w" = 1"#
);
assert_eq!(
query.to_string(SqliteQueryBuilder),
r#"SELECT "character", "size_w", "size_h" FROM "character" WHERE "size_w" = 1"#
);use sea_query::{tests_cfg::*, *};
let query = Query::select()
.columns([Char::Character, Char::SizeW, Char::SizeH])
.from(Char::Table)
.and_where(Expr::column((Char::Table, Char::SizeW)).eq(1))
.to_owned();
assert_eq!(
query.to_string(MysqlQueryBuilder),
r#"SELECT `character`, `size_w`, `size_h` FROM `character` WHERE `character`.`size_w` = 1"#
);
assert_eq!(
query.to_string(PostgresQueryBuilder),
r#"SELECT "character", "size_w", "size_h" FROM "character" WHERE "character"."size_w" = 1"#
);
assert_eq!(
query.to_string(SqliteQueryBuilder),
r#"SELECT "character", "size_w", "size_h" FROM "character" WHERE "character"."size_w" = 1"#
);Sourcepub fn tuple<I>(n: I) -> Selfwhere
I: IntoIterator<Item = Self>,
pub fn tuple<I>(n: I) -> Selfwhere
I: IntoIterator<Item = Self>,
Wraps tuple of Expr, can be used for tuple comparison
ยงExamples
use sea_query::{tests_cfg::*, *};
let query = Query::select()
.columns([Char::Character, Char::SizeW, Char::SizeH])
.from(Char::Table)
.and_where(
Expr::tuple([Expr::col(Char::SizeW).into(), Expr::value(100)])
.lt(Expr::tuple([Expr::value(500), Expr::value(100)])))
.to_owned();
assert_eq!(
query.to_string(MysqlQueryBuilder),
r#"SELECT `character`, `size_w`, `size_h` FROM `character` WHERE (`size_w`, 100) < (500, 100)"#
);
assert_eq!(
query.to_string(PostgresQueryBuilder),
r#"SELECT "character", "size_w", "size_h" FROM "character" WHERE ("size_w", 100) < (500, 100)"#
);
assert_eq!(
query.to_string(SqliteQueryBuilder),
r#"SELECT "character", "size_w", "size_h" FROM "character" WHERE ("size_w", 100) < (500, 100)"#
);pub fn table_asterisk<T>(t: T) -> Selfwhere
T: IntoIden,
Asterisk]Sourcepub fn val<V>(v: V) -> Self
pub fn val<V>(v: V) -> Self
Express a Value, returning a Expr.
ยงExamples
use sea_query::{tests_cfg::*, *};
let query = Query::select()
.columns([Char::Character, Char::SizeW, Char::SizeH])
.from(Char::Table)
.and_where(Expr::val(1).into())
.and_where(Expr::val(2.5).into())
.and_where(Expr::val("3").into())
.to_owned();
assert_eq!(
query.to_string(MysqlQueryBuilder),
r#"SELECT `character`, `size_w`, `size_h` FROM `character` WHERE 1 AND 2.5 AND '3'"#
);
assert_eq!(
query.to_string(PostgresQueryBuilder),
r#"SELECT "character", "size_w", "size_h" FROM "character" WHERE 1 AND 2.5 AND '3'"#
);
assert_eq!(
query.to_string(SqliteQueryBuilder),
r#"SELECT "character", "size_w", "size_h" FROM "character" WHERE 1 AND 2.5 AND '3'"#
);Sourcepub fn expr<T>(expr: T) -> Selfwhere
T: Into<Self>,
pub fn expr<T>(expr: T) -> Selfwhere
T: Into<Self>,
Wrap an expression to perform some operation on it later.
Since sea_query 0.32.0 (sea_orm 1.1.1), this is not necessary in most cases!
Some SQL operations used to be defined only as inherent methods on Expr.
Thus, to use them, you needed to manually convert from other types to Expr.
But now these operations are also defined as ExprTrait methods
that can be called directly on any expression type,
ยงExamples
use sea_query::{tests_cfg::*, *};
let query = Query::select()
.columns([Char::Character, Char::SizeW, Char::SizeH])
.from(Char::Table)
// This is the old style, when `Expr::expr` was necessary:
.and_where(Expr::expr(Expr::col(Char::SizeW).if_null(0)).gt(2))
.to_owned();
// But since 0.32.0, this compiles too:
let _ = Expr::col(Char::SizeW).if_null(0).gt(2);
assert_eq!(
query.to_string(MysqlQueryBuilder),
r#"SELECT `character`, `size_w`, `size_h` FROM `character` WHERE IFNULL(`size_w`, 0) > 2"#
);
assert_eq!(
query.to_string(PostgresQueryBuilder),
r#"SELECT "character", "size_w", "size_h" FROM "character" WHERE COALESCE("size_w", 0) > 2"#
);
assert_eq!(
query.to_string(SqliteQueryBuilder),
r#"SELECT "character", "size_w", "size_h" FROM "character" WHERE IFNULL("size_w", 0) > 2"#
);use sea_query::{tests_cfg::*, *};
let query = Query::select()
.column(Char::Character)
.from(Char::Table)
// This is the old style, when `Expr::expr` was necessary:
.and_where(Expr::expr(Func::lower(Expr::col(Char::Character))).is_in(["a", "b"]))
.to_owned();
// But since 0.32.0, this compiles too:
let _ = Func::lower(Expr::col(Char::Character)).is_in(["a", "b"]);
assert_eq!(
query.to_string(MysqlQueryBuilder),
r#"SELECT `character` FROM `character` WHERE LOWER(`character`) IN ('a', 'b')"#
);
assert_eq!(
query.to_string(PostgresQueryBuilder),
r#"SELECT "character" FROM "character" WHERE LOWER("character") IN ('a', 'b')"#
);
assert_eq!(
query.to_string(SqliteQueryBuilder),
r#"SELECT "character" FROM "character" WHERE LOWER("character") IN ('a', 'b')"#
);Sourcepub fn value<V>(v: V) -> Selfwhere
V: Into<Self>,
pub fn value<V>(v: V) -> Selfwhere
V: Into<Self>,
Express a Value, returning a Expr.
ยงExamples
use sea_query::{tests_cfg::*, *};
let query = Query::select()
.columns([Char::Character, Char::SizeW, Char::SizeH])
.from(Char::Table)
.and_where(Expr::value(1))
.and_where(Expr::value(2.5))
.and_where(Expr::value("3"))
.to_owned();
assert_eq!(
query.to_string(MysqlQueryBuilder),
r#"SELECT `character`, `size_w`, `size_h` FROM `character` WHERE 1 AND 2.5 AND '3'"#
);
assert_eq!(
query.to_string(PostgresQueryBuilder),
r#"SELECT "character", "size_w", "size_h" FROM "character" WHERE 1 AND 2.5 AND '3'"#
);
assert_eq!(
query.to_string(SqliteQueryBuilder),
r#"SELECT "character", "size_w", "size_h" FROM "character" WHERE 1 AND 2.5 AND '3'"#
);Sourcepub fn cust<T>(s: T) -> Self
pub fn cust<T>(s: T) -> Self
Express any custom expression in &str.
ยงExamples
use sea_query::{tests_cfg::*, *};
let query = Query::select()
.columns([Char::Character, Char::SizeW, Char::SizeH])
.from(Char::Table)
.and_where(Expr::cust("1 = 1"))
.to_owned();
assert_eq!(
query.to_string(MysqlQueryBuilder),
r#"SELECT `character`, `size_w`, `size_h` FROM `character` WHERE 1 = 1"#
);
assert_eq!(
query.to_string(PostgresQueryBuilder),
r#"SELECT "character", "size_w", "size_h" FROM "character" WHERE 1 = 1"#
);
assert_eq!(
query.to_string(SqliteQueryBuilder),
r#"SELECT "character", "size_w", "size_h" FROM "character" WHERE 1 = 1"#
);Sourcepub fn cust_with_values<T, V, I>(s: T, v: I) -> Self
pub fn cust_with_values<T, V, I>(s: T, v: I) -> Self
Express any custom expression with Value. Use this if your expression needs variables.
ยงExamples
use sea_query::{tests_cfg::*, *};
let query = Query::select()
.columns([Char::Character, Char::SizeW, Char::SizeH])
.from(Char::Table)
.and_where(Expr::col(Char::Id).eq(1))
.and_where(Expr::cust_with_values("6 = ? * ?", [2, 3]))
.to_owned();
assert_eq!(
query.to_string(MysqlQueryBuilder),
r#"SELECT `character`, `size_w`, `size_h` FROM `character` WHERE `id` = 1 AND (6 = 2 * 3)"#
);
assert_eq!(
query.to_string(SqliteQueryBuilder),
r#"SELECT "character", "size_w", "size_h" FROM "character" WHERE "id" = 1 AND (6 = 2 * 3)"#
);use sea_query::{tests_cfg::*, *};
let query = Query::select()
.columns([Char::Character, Char::SizeW, Char::SizeH])
.from(Char::Table)
.and_where(Expr::col(Char::Id).eq(1))
.and_where(Expr::cust_with_values("6 = $2 * $1", [3, 2]))
.to_owned();
assert_eq!(
query.to_string(PostgresQueryBuilder),
r#"SELECT "character", "size_w", "size_h" FROM "character" WHERE "id" = 1 AND (6 = 2 * 3)"#
);use sea_query::{tests_cfg::*, *};
let query = Query::select()
.expr(Expr::cust_with_values("6 = ? * ?", [2, 3]))
.to_owned();
assert_eq!(query.to_string(MysqlQueryBuilder), r#"SELECT 6 = 2 * 3"#);
assert_eq!(query.to_string(SqliteQueryBuilder), r#"SELECT 6 = 2 * 3"#);Postgres only: use $$ to escape $
use sea_query::{tests_cfg::*, *};
let query = Query::select()
.expr(Expr::cust_with_values("$1 $$ $2", ["a", "b"]))
.to_owned();
assert_eq!(query.to_string(PostgresQueryBuilder), r#"SELECT 'a' $ 'b'"#);use sea_query::{tests_cfg::*, *};
let query = Query::select()
.expr(Expr::cust_with_values("data @? ($1::JSONPATH)", ["hello"]))
.to_owned();
assert_eq!(
query.to_string(PostgresQueryBuilder),
r#"SELECT data @? ('hello'::JSONPATH)"#
);Sourcepub fn cust_with_expr<T, E>(s: T, expr: E) -> Self
pub fn cust_with_expr<T, E>(s: T, expr: E) -> Self
Express any custom expression with Expr. Use this if your expression needs other expression.
ยงExamples
use sea_query::{tests_cfg::*, *};
let query = Query::select()
.expr(Expr::val(1).add(2))
.expr(Expr::cust_with_expr("data @? ($1::JSONPATH)", "hello"))
.to_owned();
let (sql, values) = query.build(PostgresQueryBuilder);
assert_eq!(sql, r#"SELECT $1 + $2, data @? ($3::JSONPATH)"#);
assert_eq!(
values,
Values(vec![1i32.into(), 2i32.into(), "hello".into()])
);use sea_query::{tests_cfg::*, *};
let query = Query::select()
.expr(Expr::cust_with_expr(
"json_agg(DISTINCT $1)",
Expr::col(Char::Character),
))
.to_owned();
assert_eq!(
query.to_string(PostgresQueryBuilder),
r#"SELECT json_agg(DISTINCT "character")"#
);Sourcepub fn cust_with_exprs<T, I>(s: T, v: I) -> Self
pub fn cust_with_exprs<T, I>(s: T, v: I) -> Self
Express any custom expression with Expr. Use this if your expression needs other expressions.
Sourcepub fn exists(sel: SelectStatement) -> Self
pub fn exists(sel: SelectStatement) -> Self
Express a EXISTS sub-query expression.
ยงExamples
use sea_query::{*, tests_cfg::*};
let query = Query::select()
.expr_as(Expr::exists(Query::select().column(Char::Id).from(Char::Table).take()), "character_exists")
.expr_as(Expr::exists(Query::select().column(Glyph::Id).from(Glyph::Table).take()), "glyph_exists")
.to_owned();
assert_eq!(
query.to_string(MysqlQueryBuilder),
r#"SELECT EXISTS(SELECT `id` FROM `character`) AS `character_exists`, EXISTS(SELECT `id` FROM `glyph`) AS `glyph_exists`"#
);
assert_eq!(
query.to_string(PostgresQueryBuilder),
r#"SELECT EXISTS(SELECT "id" FROM "character") AS "character_exists", EXISTS(SELECT "id" FROM "glyph") AS "glyph_exists""#
);
assert_eq!(
query.to_string(SqliteQueryBuilder),
r#"SELECT EXISTS(SELECT "id" FROM "character") AS "character_exists", EXISTS(SELECT "id" FROM "glyph") AS "glyph_exists""#
);Sourcepub fn not_exists(sel: SelectStatement) -> Self
pub fn not_exists(sel: SelectStatement) -> Self
Express a NOT EXISTS sub-query expression.
use sea_query::{*, tests_cfg::*};
let query = Query::select()
.expr_as(Expr::not_exists(Query::select().column(Char::Id).from(Char::Table).take()), "character_exists")
.expr_as(Expr::not_exists(Query::select().column(Glyph::Id).from(Glyph::Table).take()), "glyph_exists")
.to_owned();
assert_eq!(
query.to_string(MysqlQueryBuilder),
r#"SELECT NOT EXISTS(SELECT `id` FROM `character`) AS `character_exists`, NOT EXISTS(SELECT `id` FROM `glyph`) AS `glyph_exists`"#
);
assert_eq!(
query.to_string(PostgresQueryBuilder),
r#"SELECT NOT EXISTS(SELECT "id" FROM "character") AS "character_exists", NOT EXISTS(SELECT "id" FROM "glyph") AS "glyph_exists""#
);
assert_eq!(
query.to_string(SqliteQueryBuilder),
r#"SELECT NOT EXISTS(SELECT "id" FROM "character") AS "character_exists", NOT EXISTS(SELECT "id" FROM "glyph") AS "glyph_exists""#
);Sourcepub fn any(sel: SelectStatement) -> Self
pub fn any(sel: SelectStatement) -> Self
Express a ANY sub-query expression.
ยงExamples
use sea_query::{tests_cfg::*, *};
let query = Query::select()
.column(Char::Id)
.from(Char::Table)
.and_where(Expr::col(Char::Id).eq(Expr::any(
Query::select().column(Char::Id).from(Char::Table).take(),
)))
.to_owned();
assert_eq!(
query.to_string(MysqlQueryBuilder),
r#"SELECT `id` FROM `character` WHERE `id` = ANY(SELECT `id` FROM `character`)"#
);
assert_eq!(
query.to_string(PostgresQueryBuilder),
r#"SELECT "id" FROM "character" WHERE "id" = ANY(SELECT "id" FROM "character")"#
);Sourcepub fn some(sel: SelectStatement) -> Self
pub fn some(sel: SelectStatement) -> Self
Express a SOME sub-query expression.
ยงExamples
use sea_query::{tests_cfg::*, *};
let query = Query::select()
.column(Char::Id)
.from(Char::Table)
.and_where(Expr::col(Char::Id).ne(Expr::some(
Query::select().column(Char::Id).from(Char::Table).take(),
)))
.to_owned();
assert_eq!(
query.to_string(MysqlQueryBuilder),
r#"SELECT `id` FROM `character` WHERE `id` <> SOME(SELECT `id` FROM `character`)"#
);
assert_eq!(
query.to_string(PostgresQueryBuilder),
r#"SELECT "id" FROM "character" WHERE "id" <> SOME(SELECT "id" FROM "character")"#
);Sourcepub fn all(sel: SelectStatement) -> Self
pub fn all(sel: SelectStatement) -> Self
Express a ALL sub-query expression.
Sourcepub fn case<C, T>(cond: C, then: T) -> CaseStatementwhere
C: IntoCondition,
T: Into<Self>,
pub fn case<C, T>(cond: C, then: T) -> CaseStatementwhere
C: IntoCondition,
T: Into<Self>,
Adds new CASE WHEN to existing case statement.
ยงExamples
use sea_query::{*, tests_cfg::*};
let query = Query::select()
.expr_as(
Expr::case(
Expr::col((Glyph::Table, Glyph::Aspect)).is_in([2, 4]),
true
)
.finally(false),
"is_even"
)
.from(Glyph::Table)
.to_owned();
assert_eq!(
query.to_string(PostgresQueryBuilder),
r#"SELECT (CASE WHEN ("glyph"."aspect" IN (2, 4)) THEN TRUE ELSE FALSE END) AS "is_even" FROM "glyph""#
);Sourcepub fn null() -> Self
pub fn null() -> Self
Keyword NULL.
ยงExamples
use sea_query::*;
let query = Query::select().expr(Expr::null()).to_owned();
assert_eq!(query.to_string(MysqlQueryBuilder), r#"SELECT NULL"#);
assert_eq!(query.to_string(PostgresQueryBuilder), r#"SELECT NULL"#);
assert_eq!(query.to_string(SqliteQueryBuilder), r#"SELECT NULL"#);Sourcepub fn current_date() -> Self
pub fn current_date() -> Self
Keyword CURRENT_DATE.
ยงExamples
use sea_query::*;
let query = Query::select().expr(Expr::current_date()).to_owned();
assert_eq!(query.to_string(MysqlQueryBuilder), r#"SELECT CURRENT_DATE"#);
assert_eq!(
query.to_string(PostgresQueryBuilder),
r#"SELECT CURRENT_DATE"#
);
assert_eq!(
query.to_string(SqliteQueryBuilder),
r#"SELECT CURRENT_DATE"#
);Sourcepub fn current_time() -> Self
pub fn current_time() -> Self
Keyword CURRENT_TIMESTAMP.
ยงExamples
use sea_query::*;
let query = Query::select().expr(Expr::current_time()).to_owned();
assert_eq!(query.to_string(MysqlQueryBuilder), r#"SELECT CURRENT_TIME"#);
assert_eq!(
query.to_string(PostgresQueryBuilder),
r#"SELECT CURRENT_TIME"#
);
assert_eq!(
query.to_string(SqliteQueryBuilder),
r#"SELECT CURRENT_TIME"#
);Sourcepub fn current_timestamp() -> Self
pub fn current_timestamp() -> Self
Keyword CURRENT_TIMESTAMP.
ยงExamples
use sea_query::{Expr, MysqlQueryBuilder, PostgresQueryBuilder, Query, SqliteQueryBuilder};
let query = Query::select().expr(Expr::current_timestamp()).to_owned();
assert_eq!(
query.to_string(MysqlQueryBuilder),
r#"SELECT CURRENT_TIMESTAMP"#
);
assert_eq!(
query.to_string(PostgresQueryBuilder),
r#"SELECT CURRENT_TIMESTAMP"#
);
assert_eq!(
query.to_string(SqliteQueryBuilder),
r#"SELECT CURRENT_TIMESTAMP"#
);Sourcepub fn keyword_default() -> Self
pub fn keyword_default() -> Self
Keyword DEFAULT.
SQLite does not support VALUES โโ(DEFAULT).
ยงExamples
use sea_query::{
Expr, MysqlQueryBuilder, PostgresQueryBuilder, Query, SqliteQueryBuilder, tests_cfg::*,
};
let query = Query::insert()
.columns([Char::Id])
.values_panic([Expr::keyword_default()])
.to_owned();
assert_eq!(
query.to_string(MysqlQueryBuilder),
r#"INSERT (`id`) VALUES (DEFAULT)"#
);
assert_eq!(
query.to_string(PostgresQueryBuilder),
r#"INSERT ("id") VALUES (DEFAULT)"#
);Sourcepub fn custom_keyword<T>(i: T) -> Selfwhere
T: IntoIden,
pub fn custom_keyword<T>(i: T) -> Selfwhere
T: IntoIden,
Custom keyword.
ยงExamples
use sea_query::*;
let query = Query::select()
.expr(Expr::custom_keyword("test"))
.to_owned();
assert_eq!(query.to_string(MysqlQueryBuilder), r#"SELECT test"#);
assert_eq!(query.to_string(PostgresQueryBuilder), r#"SELECT test"#);
assert_eq!(query.to_string(SqliteQueryBuilder), r#"SELECT test"#);Trait Implementationsยง
Sourceยงimpl From<DeleteStatement> for Expr
impl From<DeleteStatement> for Expr
Sourceยงfn from(v: DeleteStatement) -> Self
fn from(v: DeleteStatement) -> Self
Sourceยงimpl From<Expr> for IndexColumn
impl From<Expr> for IndexColumn
Sourceยงimpl From<FunctionCall> for Expr
impl From<FunctionCall> for Expr
Sourceยงfn from(func: FunctionCall) -> Self
fn from(func: FunctionCall) -> Self
Sourceยงimpl From<InsertStatement> for Expr
impl From<InsertStatement> for Expr
Sourceยงfn from(v: InsertStatement) -> Self
fn from(v: InsertStatement) -> Self
Sourceยงimpl From<SelectStatement> for Expr
impl From<SelectStatement> for Expr
Sourceยงfn from(v: SelectStatement) -> Self
fn from(v: SelectStatement) -> Self
Sourceยงimpl From<SubQueryStatement> for Expr
impl From<SubQueryStatement> for Expr
Sourceยงfn from(v: SubQueryStatement) -> Self
fn from(v: SubQueryStatement) -> Self
Sourceยงimpl From<UpdateStatement> for Expr
impl From<UpdateStatement> for Expr
Sourceยงfn from(v: UpdateStatement) -> Self
fn from(v: UpdateStatement) -> Self
Sourceยงimpl Into<Expr> for CaseStatement
impl Into<Expr> for CaseStatement
impl StructuralPartialEq for Expr
Auto Trait Implementationsยง
impl Freeze for Expr
impl RefUnwindSafe for Expr
impl Send for Expr
impl Sync for Expr
impl Unpin for Expr
impl UnwindSafe for Expr
Blanket Implementationsยง
ยงimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
ยงfn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
ยงimpl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
ยงunsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
clone_to_uninit)Sourceยงimpl<T> ExprTrait for T
impl<T> ExprTrait for T
Sourceยงfn as_enum<N>(self, type_name: N) -> Exprwhere
N: IntoIden,
fn as_enum<N>(self, type_name: N) -> Exprwhere
N: IntoIden,
AS enum expression. Read moreSourceยงfn cast_as<N>(self, type_name: N) -> Exprwhere
N: IntoIden,
fn cast_as<N>(self, type_name: N) -> Exprwhere
N: IntoIden,
CAST AS expression. Read moreSourceยงfn count_distinct(self) -> Expr
fn count_distinct(self) -> Expr
COUNT function with the DISTINCT modifier. Read moreSourceยงfn equals<C>(self, col: C) -> Exprwhere
C: IntoColumnRef,
fn equals<C>(self, col: C) -> Exprwhere
C: IntoColumnRef,
Sourceยงfn in_subquery(self, sel: SelectStatement) -> Expr
fn in_subquery(self, sel: SelectStatement) -> Expr
IN sub-query expression. Read moreSourceยงfn in_tuples<V, I>(self, v: I) -> Exprwhere
V: IntoValueTuple,
I: IntoIterator<Item = V>,
fn in_tuples<V, I>(self, v: I) -> Exprwhere
V: IntoValueTuple,
I: IntoIterator<Item = V>,
IN sub expression. Read moreSourceยงfn is_not_null(self) -> Expr
fn is_not_null(self) -> Expr
IS NOT NULL expression. Read moreSourceยงfn left_shift<R>(self, right: R) -> Expr
fn left_shift<R>(self, right: R) -> Expr
Sourceยงfn not_between<A, B>(self, a: A, b: B) -> Expr
fn not_between<A, B>(self, a: A, b: B) -> Expr
NOT BETWEEN expression. Read moreSourceยงfn not_equals<C>(self, col: C) -> Exprwhere
C: IntoColumnRef,
fn not_equals<C>(self, col: C) -> Exprwhere
C: IntoColumnRef,
Sourceยงfn not_in_subquery(self, sel: SelectStatement) -> Expr
fn not_in_subquery(self, sel: SelectStatement) -> Expr
NOT IN sub-query expression. Read moreSourceยงfn not_like<L>(self, like: L) -> Exprwhere
L: IntoLikeExpr,
fn not_like<L>(self, like: L) -> Exprwhere
L: IntoLikeExpr,
NOT LIKE expression. Read moreSourceยงfn right_shift<R>(self, right: R) -> Expr
fn right_shift<R>(self, right: R) -> Expr
Sourceยงimpl<T> IntoCondition for T
impl<T> IntoCondition for T
fn into_condition(self) -> Condition
Sourceยงimpl<T> IntoIndexColumn for Twhere
T: Into<IndexColumn>,
impl<T> IntoIndexColumn for Twhere
T: Into<IndexColumn>,
fn into_index_column(self) -> IndexColumn
Sourceยงimpl<T> PgExpr for Twhere
T: ExprTrait,
impl<T> PgExpr for Twhere
T: ExprTrait,
Sourceยงfn concatenate<T>(self, right: T) -> Expr
fn concatenate<T>(self, right: T) -> Expr
backend-postgres only.||) expression. Read moreSourceยงfn concat<T>(self, right: T) -> Expr
fn concat<T>(self, right: T) -> Expr
backend-postgres only.PgExpr::concatenateSourceยงfn matches<T>(self, expr: T) -> Expr
fn matches<T>(self, expr: T) -> Expr
backend-postgres only.@@) expression. Read moreSourceยงfn contains<T>(self, expr: T) -> Expr
fn contains<T>(self, expr: T) -> Expr
backend-postgres only.@>) expression. Read moreSourceยงfn contained<T>(self, expr: T) -> Expr
fn contained<T>(self, expr: T) -> Expr
backend-postgres only.<@) expression. Read moreSourceยงfn ilike<L>(self, like: L) -> Exprwhere
L: IntoLikeExpr,
fn ilike<L>(self, like: L) -> Exprwhere
L: IntoLikeExpr,
backend-postgres only.ILIKE expression. Read moreSourceยงfn not_ilike<L>(self, like: L) -> Exprwhere
L: IntoLikeExpr,
fn not_ilike<L>(self, like: L) -> Exprwhere
L: IntoLikeExpr,
backend-postgres only.NOT ILIKE expressionSourceยงfn get_json_field<T>(self, right: T) -> Expr
fn get_json_field<T>(self, right: T) -> Expr
backend-postgres only.->). Read moreSourceยงimpl<T> SqliteExpr for Twhere
T: ExprTrait,
impl<T> SqliteExpr for Twhere
T: ExprTrait,
Sourceยงfn glob<T>(self, right: T) -> Expr
fn glob<T>(self, right: T) -> Expr
backend-sqlite only.GLOB operator. Read moreSourceยงfn matches<T>(self, right: T) -> Expr
fn matches<T>(self, right: T) -> Expr
backend-sqlite only.MATCH operator. Read moreSourceยงfn get_json_field<T>(self, right: T) -> Expr
fn get_json_field<T>(self, right: T) -> Expr
backend-sqlite only.->). Read more