-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnode.go
More file actions
22 lines (20 loc) · 751 Bytes
/
Copy pathnode.go
File metadata and controls
22 lines (20 loc) · 751 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
package gooq
// node is the sealed contract every element of the abstract syntax tree
// satisfies. Because render is unexported, only types declared inside this
// package can satisfy interfaces that embed node. This seals the public
// Field, Condition, Table, OrderField, AnyField, and Assignment interfaces:
// callers may use them but cannot provide their own implementations.
type node interface {
// render writes this element's SQL fragment into the builder, appending any
// bind arguments in left-to-right order.
render(b *builder)
}
// renderList renders a comma-separated list of nodes into the builder.
func renderList(b *builder, nodes []node) {
for i, n := range nodes {
if i > 0 {
b.writeString(", ")
}
n.render(b)
}
}