numberField
const numberField: (input) => PostgrestFieldSpec;Defined in: filters/postgrest.ts:84
Allow-list a public field as a number filter over a PostgREST column. between becomes
gte + lte (two params on the same column, which PostgREST ANDs).
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
input |
{ column: string; } |
input.column |
string |
Returns
Section titled “Returns”Example
Section titled “Example”import { buildParams, numberField } from "@xtandard/lib/filters/postgrest";
const { params } = buildParams({ spec: { total: numberField({ column: "total" }) }, filters: [{ field: "total", filter: { kind: "number", operator: "between", from: 10, to: 20 } }],});// params → [["total", "gte.10"], ["total", "lte.20"]]