Skip to main content

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

KeyTypeReadonlyDescription
_typeSerializationType.UPPER_STATEMENTYesDiscriminates this node during serialization.
_expressionanyNoThe argument passed to the constructor.
_aliasstring | undefinedNoSet 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

See also