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::col((Glyph::Table, Glyph::Aspect)).is_in([3, 4]),
Expr::col((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%'"#
);