Expand description
or_() and and_(), and the ConditionGroup they make.
A group writes one set of brackets around its whole chain and none around
each operand. A chain stays flat while the operator does not change:
a.or_(b).or_(c) gives (a OR b OR c). Nesting makes a different group:
a.or_(b.or_(c)) gives (a OR (b OR c)).
The group writes the brackets, not the statement renderer: WHERE joins
its conditions with a plain AND, so a search on top of a table’s
conditions reads role = 'admin' AND (a OR b). Without the group it would
read role = 'admin' AND a OR b, which means (role = 'admin' AND a) OR b.
Structs§
- Condition
Group - Conditions that one logical operator joins, written as a single
group in brackets. To make a group, call
or_orand_, or use theor_andand_methods on a column or an identifier.