42ab71e964
Signed-off-by: Anton Nesterov <anton@demiurg.io>
19 lines
348 B
Go
19 lines
348 B
Go
package filters
|
|
|
|
type Lte struct {
|
|
Lte interface{} `json:"$lte"`
|
|
}
|
|
|
|
func (f Lte) FromJSON(data interface{}) IFilter {
|
|
return FromJson[Lte](data)
|
|
}
|
|
|
|
func (f Lte) ToSQLPart(ctx Dialect) (string, Values) {
|
|
if f.Lte == nil {
|
|
return "", nil
|
|
}
|
|
name := ctx.GetFieldName()
|
|
value := ctx.NormalizeValue(f.Lte)
|
|
return FmtCompare("<=", name, value)
|
|
}
|