dal/pkg/filters/Gte.go

19 lines
348 B
Go
Raw Permalink Normal View History

package filters
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 Dialect) (string, Values) {
if f.Gte == nil {
return "", nil
}
name := ctx.GetFieldName()
value := ctx.NormalizeValue(f.Gte)
return FmtCompare(">=", name, value)
}