-
Notifications
You must be signed in to change notification settings - Fork 0
/
delete.go
74 lines (58 loc) · 1.76 KB
/
delete.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
71
72
73
74
package azamat
import (
"database/sql"
sq "github.com/Masterminds/squirrel"
)
type DeleteBuilder struct {
sq.DeleteBuilder
}
func Delete(from string) DeleteBuilder {
return DeleteBuilder{sq.Delete(from)}
}
func (b DeleteBuilder) Run(runner Runner) (sql.Result, error) {
return b.RunWith(runner).Exec()
}
func (b DeleteBuilder) PlaceholderFormat(f sq.PlaceholderFormat) DeleteBuilder {
b.DeleteBuilder = b.DeleteBuilder.PlaceholderFormat(f)
return b
}
func (b DeleteBuilder) RunWith(runner sq.BaseRunner) DeleteBuilder {
b.DeleteBuilder = b.DeleteBuilder.RunWith(runner)
return b
}
func (b DeleteBuilder) Prefix(sql string, args ...interface{}) DeleteBuilder {
b.DeleteBuilder = b.DeleteBuilder.Prefix(sql, args...)
return b
}
func (b DeleteBuilder) PrefixExpr(expr sq.Sqlizer) DeleteBuilder {
b.DeleteBuilder = b.DeleteBuilder.PrefixExpr(expr)
return b
}
func (b DeleteBuilder) From(from string) DeleteBuilder {
b.DeleteBuilder = b.DeleteBuilder.From(from)
return b
}
func (b DeleteBuilder) Where(pred interface{}, args ...interface{}) DeleteBuilder {
b.DeleteBuilder = b.DeleteBuilder.Where(pred, args...)
return b
}
func (b DeleteBuilder) OrderBy(orderBys ...string) DeleteBuilder {
b.DeleteBuilder = b.DeleteBuilder.OrderBy(orderBys...)
return b
}
func (b DeleteBuilder) Limit(limit uint64) DeleteBuilder {
b.DeleteBuilder = b.DeleteBuilder.Limit(limit)
return b
}
func (b DeleteBuilder) Offset(offset uint64) DeleteBuilder {
b.DeleteBuilder = b.DeleteBuilder.Offset(offset)
return b
}
func (b DeleteBuilder) Suffix(sql string, args ...interface{}) DeleteBuilder {
b.DeleteBuilder = b.DeleteBuilder.Suffix(sql, args...)
return b
}
func (b DeleteBuilder) SuffixExpr(expr sq.Sqlizer) DeleteBuilder {
b.DeleteBuilder = b.DeleteBuilder.SuffixExpr(expr)
return b
}