Skip to main content

InnerJoin

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

Constructor

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

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

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

Select().from('customers c').join(InnerJoin('orders o').on(Eq('o.customer_id', Field('c.id'))));
// ... inner join orders o on o.customer_id = c.id

Properties

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

Methods

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

See also