-
Notifications
You must be signed in to change notification settings - Fork 0
/
raw.go
29 lines (23 loc) · 720 Bytes
/
raw.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
package dat
// RawBuilder builds SQL from raw SQL.
type RawBuilder struct {
Execer
sql string
args []interface{}
}
// NewRawBuilder creates a new RawBuilder for the given SQL string and arguments
func NewRawBuilder(sql string, args ...interface{}) *RawBuilder {
return &RawBuilder{sql: sql, args: args}
}
// ToSQL implements builder interface
func (b *RawBuilder) ToSQL() (string, []interface{}) {
return b.sql, b.args
}
// Interpolate interpolates this builder's SQL.
func (b *RawBuilder) Interpolate() (string, []interface{}, error) {
return interpolate(b)
}
// MustInterpolate interpolates this builder's SQL.
func (b *RawBuilder) MustInterpolate() (string, []interface{}) {
return mustInterpolate(b)
}