Upper
Builds an upper(expression) expression, usable anywhere an SQL element is accepted (typically as
a Select column or operator operand).
Constructor
Upper(expression: any): Upper
new Upper(expression: any): Upper
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 { Upper, Select } from '@sqb/builder';
Select(Upper('country_code').as('cc')).from('customers');
// select upper(country_code) cc from customers
Properties
| Key | Type | Readonly | Description |
|---|---|---|---|
_type | SerializationType.UPPER_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).
Upper('country_code').as('cc');
// upper(country_code) cc