Macro sea_query::query::all

source ·
macro_rules! all {
    ( $( $x:expr ),* $(,)?) => { ... };
}
Expand description

Macro to easily create an Condition::all.

Examples

use sea_query::{*, tests_cfg::*};

let query = Query::select()
    .column(Glyph::Image)
    .from(Glyph::Table)
    .cond_where(
        all![
            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) AND `glyph`.`image` LIKE 'A%'"#
);