You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
go-library/vendor/gorm.io/hints/exprs.go

25 lines
486 B

package hints
import "gorm.io/gorm/clause"
type Exprs []clause.Expression
func (exprs Exprs) Build(builder clause.Builder) {
for idx, expr := range exprs {
if idx > 0 {
builder.WriteByte(' ')
}
expr.Build(builder)
}
}
func squashExpression(expression clause.Expression, do func(expression clause.Expression)) {
if exprs, ok := expression.(Exprs); ok {
for _, expr := range exprs {
squashExpression(expr, do)
}
} else if expression != nil {
do(expression)
}
}