Is
IS-comparison, typically used for null checks (left is right). Extends
CompOperator. Shorthand key: is.
Constructor
Is(left: string | SqlElement, right?: any): Is
new Is(left: string | SqlElement, right?: any): Is
Dual-callable. left can be a field-name string (optionally with a trailing []) or an SQL
element.
import { Is, Select } from '@sqb/builder';
Select().from('customers').where(Is('deleted_at', null));
// where deleted_at is null
Properties
Inherits every property from CompOperator (_type, _left, _right,
_symbol, _isArray); _symbol is always 'is'.
Methods
Inherits ._serialize() from
CompOperator; Is adds no methods of its own.
Object-literal shorthand
Select().from('customers').where({ 'deleted_at is': null });
// where deleted_at is null