booleanField
function booleanField(input): FieldSpec;Defined in: filters/drizzle/spec.ts:151
Allow-list a public field as a boolean filter (eq/ne/null checks) over a Drizzle
boolean column. Passing a non-boolean column is a compile error.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
input |
{ column: ColumnOf<boolean>; } |
input.column |
ColumnOf<boolean> |
Returns
Section titled “Returns”Example
Section titled “Example”import { boolean, PgDialect, pgTable } from "drizzle-orm/pg-core";import { booleanField, buildWhere } from "@xtandard/lib/filters/drizzle";
const tasks = pgTable("tasks", { done: boolean("done") });const { where } = buildWhere({ spec: { done: booleanField({ column: tasks.done }) }, filters: [{ field: "done", filter: { kind: "boolean", operator: "eq", value: false } }],});const { sql, params } = new PgDialect().sqlToQuery(where!);// sql → '"tasks"."done" = $1', params → [false]