in and not in support empty arrays
This commit is contained in:
parent
0e9bb664cd
commit
5fecbbd4e2
@ -376,10 +376,20 @@ func (e *expr) in(operator string, values ...interface{}) *expr {
|
||||
}
|
||||
|
||||
func (e *expr) In(values ...interface{}) *expr {
|
||||
if len(values) == 0 {
|
||||
e.expr = "1 = 0"
|
||||
return e
|
||||
}
|
||||
|
||||
return e.in("", values...)
|
||||
}
|
||||
|
||||
func (e *expr) NotIn(values ...interface{}) *expr {
|
||||
if len(values) == 0 {
|
||||
e.expr = "1 = 1"
|
||||
return e
|
||||
}
|
||||
|
||||
return e.in(" NOT", values...)
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user