Skip to main content

Lte

Less-than-or-equal comparison (left <= right). Extends CompOperator. Shorthand keys: <=, lte.

Constructor

Lte(left: string | SqlElement, right?: any): Lte
new Lte(left: string | SqlElement, right?: any): Lte

Dual-callable. left can be a field-name string (optionally with a trailing []) or an SQL element; right can be a literal, Param, Raw, or sub-Select.

import { Lte, Select } from '@sqb/builder';

Select().from('customers').where(Lte('price', 100));
// where price <= 100

Properties

Inherits every property from CompOperator (_type, _left, _right, _symbol, _isArray); _symbol is always '<='.

Methods

Inherits ._serialize() from CompOperator; Lte adds no methods of its own.

Object-literal shorthand

Select().from('customers').where({ 'price <=': 100, 'age lte': 18 });
// where price <= 100 and age <= 18

See also