Open History to see the last commit
1---
2id: toBooleanPredicate
3title: toBooleanPredicate
4---
5
6```ts
7function toBooleanPredicate(result): boolean;
8```
9
10Defined in: [packages/db/src/query/compiler/evaluators.ts:79](https://github.com/TanStack/db/blob/main/packages/db/src/query/compiler/evaluators.ts#L79)
11
12Converts a 3-valued logic result to a boolean for use in WHERE/HAVING filters.
13In SQL, UNKNOWN (null) values in WHERE clauses exclude rows, matching false behavior.
14
15## Parameters
16
17### result
18
19The 3-valued logic result: true, false, or null (UNKNOWN)
20
21`boolean` | `null`
22
23## Returns
24
25`boolean`
26
27true only if result is explicitly true, false otherwise
28
29Truth table:
30- true → true (include row)
31- false → false (exclude row)
32- null (UNKNOWN) → false (exclude row, matching SQL behavior)