dal/pkg/filters/Gte.go
Anton Nesterov 43dd4e9234
[ref] name things what they are
Signed-off-by: Anton Nesterov <anton@demiurg.io>
2024-08-11 21:49:49 +02:00

23 lines
359 B
Go

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