dal/pkg/filters/And.go

23 lines
352 B
Go
Raw Normal View History

package filters
import (
"fmt"
"strings"
)
type And struct {
And []string `json:"$and"`
}
func (f And) ToSQLPart(ctx Dialect) (string, Values) {
if f.And == nil {
return "", nil
}
value := strings.Join(f.And, " AND ")
return fmt.Sprintf("(%s)", value), nil
}
2024-08-08 17:26:29 +00:00
func (a And) FromJSON(data interface{}) IFilter {
return FromJson[And](data)
}