Skip to main content

LeftJoin

A Join subclass that hard-codes JoinType.LEFT, rendering left join. See the Joins guide for a full walkthrough.

Constructor

LeftJoin(table: string | TableName | Select | Raw): LeftJoin
new LeftJoin(table: string | TableName | Select | Raw): LeftJoin

Dual-callable. Equivalent to Join(JoinType.LEFT, table).

import { LeftJoin, Eq, Field, Select } from '@sqb/builder';

Select().from('customers c').join(LeftJoin('addresses a').on(Eq('a.customer_id', Field('c.id'))));
// ... left join addresses a on a.customer_id = c.id

Properties

Inherits every property from Join (_type, _joinType, _table, _conditions); _joinType is always JoinType.LEFT.

Methods

Inherits .on() from Join; LeftJoin adds no methods of its own.

See also