dal/pkg/filters/Gte.go

23 lines
359 B
Go
Raw Normal View History

package filters
import (
"fmt"
)
type Gte struct {
Gte interface{} `json:"$gte"`
}
2024-08-08 17:26:29 +00:00
func (f Gte) FromJSON(data interface{}) IFilter {
return FromJson[Gte](data)
}
func (f Gte) ToSQLPart(ctx Context) string {
if f.Gte == nil {
return ""
}
name := ctx.GetFieldName()
value := ctx.NormalizeValue(f.Gte)
return fmt.Sprintf("%s >= %v", name, value)
}