-
Notifications
You must be signed in to change notification settings - Fork 208
/
builder.go
22 lines (19 loc) · 656 Bytes
/
builder.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
package dbr
// Builder builds SQL in Dialect like MySQL, and PostgreSQL.
// The raw SQL and values are stored in Buffer.
//
// The core of gocraft/dbr is interpolation, which can expand ? with arbitrary SQL.
// If you need a feature that is not currently supported, you can build it
// on your own (or use Expr).
//
// To do that, the value that you wish to be expanded with ? needs to
// implement Builder.
type Builder interface {
Build(Dialect, Buffer) error
}
// BuildFunc implements Builder.
type BuildFunc func(Dialect, Buffer) error
// Build calls itself to build SQL.
func (b BuildFunc) Build(d Dialect, buf Buffer) error {
return b(d, buf)
}