Skip to content

Query condition simplification incoming processing #148

Answered by tyt2y3
zhangwuqiao asked this question in Q&A
Discussion options

You must be logged in to vote

Okay this is the final one

use sea_query::{*, tests_cfg::*};
let query = Query::select()
    .column(Glyph::Image)
    .from(Glyph::Table)
    .cond_where(
        Cond::all()
            .add_option(Some(Expr::tbl(Glyph::Table, Glyph::Image).like("A%")))
            .add_option(None::<SimpleExpr>)
    )
    .to_owned();
assert_eq!(
    query.to_string(MysqlQueryBuilder),
    r#"SELECT `image` FROM `glyph` WHERE `glyph`.`image` LIKE 'A%'"#
);

Replies: 5 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by tyt2y3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #144 on September 29, 2021 06:34.