Lower
Builds a lower(expression) expression, usable anywhere an SQL element is accepted (typically as
a Select column or operator operand).
Constructor
Lower(expression: any): Lower
new Lower(expression: any): Lower
Dual-callable. expression is converted through the active SerializeContext (so a string,
literal, Field, or Raw are all accepted). Serializes to an empty string if expression is
falsy.
import { Lower, Select } from '@sqb/builder';
Select(Lower('email').as('email_lc')).from('customers');
// select lower(email) email_lc from customers
Properties
| Key | Type | Readonly | Description |
|---|---|---|---|
_type | SerializationType.LOWER_STATEMENT | Yes | Discriminates this node during serialization. |
_expression | any | No | The argument passed to the constructor. |
_alias | string | undefined | No | Set by .as(). |
Methods
as()
as(alias: string): this
Sets an alias, rendered as a trailing alias after the closing paren (no AS keyword).
Lower('email').as('email_lc');
// lower(email) email_lc