Macro sea_query::any [−][src]
macro_rules! any {
($($x : expr), *) => { ... };
}
Expand description
Macro to easily create an Condition::any
.
Examples
use sea_query::{*, tests_cfg::*};
let query = Query::select()
.column(Glyph::Image)
.from(Glyph::Table)
.cond_where(
any![
Expr::tbl(Glyph::Table, Glyph::Aspect).is_in(vec![3, 4]),
Expr::tbl(Glyph::Table, Glyph::Image).like("A%")
]
)
.to_owned();
assert_eq!(
query.to_string(MysqlQueryBuilder),
r#"SELECT `image` FROM `glyph` WHERE `glyph`.`aspect` IN (3, 4) OR `glyph`.`image` LIKE 'A%'"#
);