Skip to main content

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

KeyTypeReadonlyDescription
_typeSerializationType.LOWER_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).

Lower('email').as('email_lc');
// lower(email) email_lc

See also