mirror of
https://github.com/bitechdev/ResolveSpec.git
synced 2026-10-14 09:16:28 +00:00
feat(restheadspec): match NULL when x-fieldfilter compares a numeric column to 0
Adds a SetNullAsZero handler option: on by default in restheadspec (for x-fieldfilter only), off by default in resolvespec. When enabled, an eq filter of 0 on a numeric column renders (col = 0 OR col IS NULL).
This commit is contained in:
@@ -87,6 +87,10 @@ type FilterOption struct {
|
||||
Operator string `json:"operator"`
|
||||
Value interface{} `json:"value"`
|
||||
LogicOperator string `json:"logic_operator"` // "AND" or "OR" - how this filter combines with previous filters
|
||||
|
||||
// NullAsZero makes an "eq" filter on a numeric column with a zero value also
|
||||
// match NULLs (COALESCE(col, 0) = 0). Set for x-fieldfilter headers only.
|
||||
NullAsZero bool `json:"-"`
|
||||
}
|
||||
|
||||
type SortOption struct {
|
||||
|
||||
Reference in New Issue
Block a user