/
components.go
70 lines (62 loc) · 1.31 KB
/
components.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
69
70
package sqlx
// Компоненты запроса
type components struct {
Aggregate []aggregateComponent
Select []interface{}
Insert []interface{}
Update []interface{}
Delete []interface{}
From []fromComponent
Join []joinComponent
Into []interface{}
Columns []interface{}
Values []valueComponent
OrIgnore []interface{}
ReturnId []interface{}
Set []setComponent
Where []whereComponent
Group []interface{}
Having []havingComponent
Order []orderComponent
Limit []interface{}
Offset []interface{}
}
func newComponents() *components {
return &components{}
}
type aggregateComponent struct {
function string
column interface{}
alias string
}
type fromComponent struct {
kind string
table interface{}
builder *Builder
}
type joinComponent Joiner
type valueComponent []interface{}
type setComponent Data
type whereComponent struct {
kind string
column interface{}
operator interface{}
value interface{}
min interface{}
max interface{}
boolean interface{}
list List
builder *Builder
}
type havingComponent struct {
kind string
column interface{}
operator interface{}
value interface{}
boolean interface{}
builder *Builder
}
type orderComponent struct {
column string
direction string
}