xb

All Filtering Mechanisms (English)

This document is the English counterpart of xb/doc/ALL_FILTERING_MECHANISMS.md. It explains how xb automatically skips empty inputs, how InRequired protects destructive operations, and how higher level blocks behave when their internal conditions collapse.


1. Single-value guards

xb.Of("t_user").
    Eq("status", 0).      // skipped
    Eq("status", 1).      // included
    Like("name", "").     // skipped
    Like("name", "ai").   // included
    Build()

2. IN / NOT IN

xb.Of("orders").
    In("id", 0, nil, 9, 10).         // renders IN (9,10)

xb.Of("orders").
    InRequired("id", ids...).        // panic if ids collapses to empty

3. Compound blocks


4. LIKE helpers


5. Debugging tips

Symptom Explanation
Condition missing Value was auto-filtered; inspect built.Conds
IN disappeared Input collapsed to zero elements
OR block missing Every nested condition skipped
Need strict enforcement Swap to InRequired or add X() raw expressions

Use fmt.Printf("%#v\n", built.Conds) in tests to inspect the final AST.