forked from Masterminds/squirrel
-
Notifications
You must be signed in to change notification settings - Fork 1
/
condition.go
68 lines (63 loc) · 2.17 KB
/
condition.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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
package squirrel
type WhereConditions interface {
ToSql() (string, []interface{}, error)
PlaceholderFormat(PlaceholderFormat) WhereConditions
Where(interface{}, ...interface{}) WhereConditions
Condition() WhereConditions
Expr(string, ...interface{}) WhereConditions
Eq(string, interface{}) WhereConditions
NotEq(string, interface{}) WhereConditions
Gt(string, interface{}) WhereConditions
GtOrEq(string, interface{}) WhereConditions
Lt(string, interface{}) WhereConditions
LtOrEq(string, interface{}) WhereConditions
OrderBy(...string) WhereConditions
GroupBy(...string) WhereConditions
Having(interface{}, ...interface{}) WhereConditions
Limit(int) WhereConditions
Offset(int) WhereConditions
Suffix(string, ...interface{}) WhereConditions
}
type SelectCondition interface {
Prefix(string, ...interface{}) SelectCondition
Distinct() SelectCondition
Options(...string) SelectCondition
Columns(...string) SelectCondition
Column(interface{}, ...interface{}) SelectCondition
From(string) SelectCondition
FromSelect(SelectCondition, string) SelectCondition
JoinCondition
}
type JoinCondition interface {
JoinClause(interface{}, ...interface{}) JoinCondition
Join(string, ...interface{}) JoinCondition
LeftJoin(string, ...interface{}) JoinCondition
RightJoin(string, ...interface{}) JoinCondition
WhereConditions
}
type UpdateCondition interface {
Prefix(string, ...interface{}) UpdateCondition
Table(string) UpdateCondition
Set(string, interface{}) UpdateCondition
IncrBy(string, int) UpdateCondition
DecrBy(string, int) UpdateCondition
SetMap(map[string]interface{}) UpdateCondition
WhereConditions
}
type DeleteCondition interface {
Prefix(string, ...interface{}) DeleteCondition
From(string) DeleteCondition
WhereConditions
}
type InsertCondition interface {
ToSql() (string, []interface{}, error)
PlaceholderFormat(PlaceholderFormat) InsertCondition
Prefix(string, ...interface{}) InsertCondition
Options(...string) InsertCondition
Into(string) InsertCondition
Columns(...string) InsertCondition
Values(...interface{}) InsertCondition
Suffix(string, ...interface{}) InsertCondition
SetMap(map[string]interface{}) InsertCondition
Select(SelectCondition) InsertCondition
}