|
IronQuery
A SQL-first query builder for C++
|
Transitional representation for CASE WHEN ... END. More...
#include <case_builder.hpp>
Public Member Functions | |
| CaseBuilder ()=default | |
| Starts an empty CASE expression; call When to add branches. | |
| CaseBuilder | When (Condition cond) && |
Begins a new WHEN cond branch. | |
| CaseBuilder | Then (Expr result) && |
Completes the pending branch as WHEN cond THEN result. | |
| CaseBuilder | Else (Expr result) && |
Sets the ELSE result fallback branch. | |
| Expr | End () const |
Finalizes the expression as CASE ... [ELSE ...] END. | |
Transitional representation for CASE WHEN ... END.
| CaseBuilder iron_query::CaseBuilder::Else | ( | Expr | result | ) | && |
Sets the ELSE result fallback branch.
Then/Else branches of the same CASE share a compatible result type. | Expr iron_query::CaseBuilder::End | ( | ) | const |
Finalizes the expression as CASE ... [ELSE ...] END.
| LogicError | if no WHEN/THEN pair was added. |
| CaseBuilder iron_query::CaseBuilder::Then | ( | Expr | result | ) | && |
Completes the pending branch as WHEN cond THEN result.
| LogicError | if not preceded by When. |
Then/Else branches of the same CASE share a compatible result type. | CaseBuilder iron_query::CaseBuilder::When | ( | Condition | cond | ) | && |
Begins a new WHEN cond branch.
| LogicError | if called twice in a row without a matching Then in between. |