Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.
Sign upHelp translate sql to diesel #1176
Comments
This comment has been minimized.
let case_1 = chat_id.eq(1).and(position.eq_any(vec![1, 2, 3]));
let case_2 = chat_id.eq(2).and(position.eq_any(vec![3, 4, 5]));
let case_3 = chat_id.eq(3).and(position.eq_any(vec![6, 7, 8]));
messages.filter(case_1.or(case_2).or(case_3)) |
sgrif
closed this
Sep 19, 2017
This comment has been minimized.
xinghun92
commented
Sep 19, 2017
|
How can I use it dynamically?
and what the Initial should be? |
This comment has been minimized.
|
You'll need to box it in that case. http://docs.diesel.rs/diesel/expression/trait.BoxableExpression.html |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
xinghun92 commentedSep 19, 2017
I have many messages and many chats, one message belongs to only one chat and has a unique position in this chat. And I want to get messages in different chats with different positions. Does diesel support query like this?