forked from goal-web/querybuilder
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnull.go
25 lines (20 loc) · 787 Bytes
/
null.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
package querybuilder
import "github.com/goal-web/contracts"
func (this *Builder) WhereIsNull(field string, whereType ...contracts.WhereJoinType) contracts.QueryBuilder {
if len(whereType) == 0 {
return this.Where(field, "is", "null")
}
return this.Where(field, "is", "null", whereType[0])
}
func (this *Builder) WhereNotNull(field string, whereType ...contracts.WhereJoinType) contracts.QueryBuilder {
if len(whereType) == 0 {
return this.Where(field, "is not", "null")
}
return this.Where(field, "is not", "null", whereType[0])
}
func (this *Builder) OrWhereIsNull(field string) contracts.QueryBuilder {
return this.OrWhere(field, "is", "null")
}
func (this *Builder) OrWhereNotNull(field string) contracts.QueryBuilder {
return this.OrWhere(field, "is not", "null")
}