forked from doug-martin/goqu
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtruncate_clauses.go
50 lines (42 loc) · 1.01 KB
/
truncate_clauses.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
package exp
type (
TruncateClauses interface {
HasTable() bool
clone() *truncateClauses
Table() ColumnListExpression
SetTable(tables ColumnListExpression) TruncateClauses
Options() TruncateOptions
SetOptions(opts TruncateOptions) TruncateClauses
}
truncateClauses struct {
tables ColumnListExpression
options TruncateOptions
}
)
func NewTruncateClauses() TruncateClauses {
return &truncateClauses{}
}
func (tc *truncateClauses) HasTable() bool {
return tc.tables != nil
}
func (tc *truncateClauses) clone() *truncateClauses {
return &truncateClauses{
tables: tc.tables,
}
}
func (tc *truncateClauses) Table() ColumnListExpression {
return tc.tables
}
func (tc *truncateClauses) SetTable(tables ColumnListExpression) TruncateClauses {
ret := tc.clone()
ret.tables = tables
return ret
}
func (tc *truncateClauses) Options() TruncateOptions {
return tc.options
}
func (tc *truncateClauses) SetOptions(opts TruncateOptions) TruncateClauses {
ret := tc.clone()
ret.options = opts
return ret
}