File tree Expand file tree Collapse file tree 2 files changed +20
-4
lines changed
Expand file tree Collapse file tree 2 files changed +20
-4
lines changed Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ members = [
1111
1212[package ]
1313name = " rorm"
14- version = " 0.9.4 "
14+ version = " 0.9.5 "
1515edition = " 2021"
1616repository = " https://github.com/rorm-orm/rorm"
1717authors = [
" gammelalf" ,
" myOmikron <[email protected] >" ]
Original file line number Diff line number Diff line change @@ -32,12 +32,28 @@ where
3232 B : Condition < ' a > ,
3333{
3434 fn build ( & self , mut builder : ConditionBuilder < ' _ , ' a > ) {
35+ let bool_fallback;
36+ let collection_operator;
37+ let binary_operator;
38+ match self . operator {
39+ InOperator :: In => {
40+ bool_fallback = false ;
41+ collection_operator = CollectionOperator :: Or ;
42+ binary_operator = BinaryOperator :: Equals ;
43+ }
44+ InOperator :: NotIn => {
45+ bool_fallback = true ;
46+ collection_operator = CollectionOperator :: And ;
47+ binary_operator = BinaryOperator :: NotEquals ;
48+ }
49+ }
50+
3551 if self . snd_arg . is_empty ( ) {
36- Value :: Bool ( false ) . build ( builder) ;
52+ Value :: Bool ( bool_fallback ) . build ( builder) ;
3753 } else {
38- builder. push_condition ( FlatCondition :: StartCollection ( CollectionOperator :: Or ) ) ;
54+ builder. push_condition ( FlatCondition :: StartCollection ( collection_operator ) ) ;
3955 for snd_arg in self . snd_arg . iter ( ) {
40- builder. push_condition ( FlatCondition :: BinaryCondition ( BinaryOperator :: Equals ) ) ;
56+ builder. push_condition ( FlatCondition :: BinaryCondition ( binary_operator ) ) ;
4157 self . fst_arg . build ( builder. reborrow ( ) ) ;
4258 snd_arg. build ( builder. reborrow ( ) ) ;
4359 }
You can’t perform that action at this time.
0 commit comments