Fluent builder for CASE expressions.
const expr = caseWhen() .when(col('x').gt(lit(0)), lit('positive')) .else_(lit('negative')) .build(); Copy
const expr = caseWhen() .when(col('x').gt(lit(0)), lit('positive')) .else_(lit('negative')) .build();
Build the CASE expression as an Expr.
Set the ELSE result.
Generate SQL string (generic dialect).
Add a WHEN condition THEN result branch.
Fluent builder for CASE expressions.
Example