booleanField
const booleanField: (input) => KnexFieldSpec;Defined in: filters/knex.ts:107
Allow-list a public field as a boolean filter (eq/ne/null checks) over a column named
by a column string ("done" or "tasks.done").
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
input |
{ column: string; } |
input.column |
string |
Returns
Section titled “Returns”Example
Section titled “Example”import { booleanField, buildWhereSql } from "@xtandard/lib/filters/knex";
buildWhereSql({ spec: { done: booleanField({ column: "tasks.done" }) }, filters: [{ field: "done", filter: { kind: "boolean", operator: "eq", value: false } }],});// → { sql: '"tasks"."done" = ?', bindings: [false] }