Selecto.Builder.CaseExpression (Selecto v0.4.5)

Copy Markdown

SQL generation for PostgreSQL CASE expressions.

Generates SQL for both simple and searched CASE expressions with proper condition handling, value escaping, and PostgreSQL-specific syntax.

Summary

Functions

Build CASE expression SQL from specification.

Build CASE expression SQL for SELECT clause integration.

Functions

build_case_expression(spec, selecto \\ nil)

Build CASE expression SQL from specification.

Returns {case_expression_iodata, parameters} tuple with proper PostgreSQL CASE syntax and parameter bindings.

build_case_for_select(spec, selecto \\ nil)

Build CASE expression SQL for SELECT clause integration.

Returns formatted CASE expression with proper aliasing for column selection.