> ## Documentation Index
> Fetch the complete documentation index at: https://docs.bijection.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Class: RelationalQuery<Expr>

> Not exported: an exported type refers to it.

[browser](/api/modules/browser).RelationalQuery

Not exported: an exported type refers to it.

## Type parameters

| Name |
| :- |
| `Expr` |

## Constructors

### constructor

• **new RelationalQuery**\<`Expr`>(`expression`)

#### Type parameters

| Name |
| :- |
| `Expr` |

#### Parameters

| Name | Type |
| :- | :- |
| `expression` | [`QueryExpression`](/api/modules/browser#queryexpression) |

## Properties

### expressionType

• `Readonly` **expressionType**: `Expr`

***

### expression

• `Readonly` **expression**: [`QueryExpression`](/api/modules/browser#queryexpression)

## Methods

### as

▸ **as**\<`Name`>(`alias`): [`RelationalQuery`](/api/classes/browser.RelationalQuery)\<[`Alias`](/api/modules/browser#alias)\<`Expr`, `Name`>>

#### Type parameters

| Name | Type |
| :- | :- |
| `Name` | extends `string` |

#### Parameters

| Name | Type |
| :- | :- |
| `alias` | `Name` |

#### Returns

[`RelationalQuery`](/api/classes/browser.RelationalQuery)\<[`Alias`](/api/modules/browser#alias)\<`Expr`, `Name`>>

***

### filter

▸ **filter**\<`Predicate`>(`predicate`): [`RelationalQuery`](/api/classes/browser.RelationalQuery)\<[`Filter`](/api/modules/browser#filter)\<`Expr`, `Predicate`>>

#### Type parameters

| Name | Type |
| :- | :- |
| `Predicate` | extends [`Expression`](/api/classes/browser.Expression)\<`boolean`, `Predicate`> |

#### Parameters

| Name | Type |
| :- | :- |
| `predicate` | `Predicate` |

#### Returns

[`RelationalQuery`](/api/classes/browser.RelationalQuery)\<[`Filter`](/api/modules/browser#filter)\<`Expr`, `Predicate`>>

***

### select

▸ **select**\<`Fields`>(`fields`): [`RelationalQuery`](/api/classes/browser.RelationalQuery)\<[`Select`](/api/modules/browser#select)\<`Expr`, `Fields`>>

#### Type parameters

| Name | Type |
| :- | :- |
| `Fields` | extends [`Selection`](/api/modules/browser#selection) |

#### Parameters

| Name | Type |
| :- | :- |
| `fields` | `Fields` |

#### Returns

[`RelationalQuery`](/api/classes/browser.RelationalQuery)\<[`Select`](/api/modules/browser#select)\<`Expr`, `Fields`>>

***

### leftJoin

▸ **leftJoin**\<`Right`, `Options`>(`right`, `options`): [`RelationalQuery`](/api/classes/browser.RelationalQuery)\<[`Join`](/api/modules/browser#join)\<`Expr`, `Right`, `"left"`, `Options`>>

#### Type parameters

| Name | Type |
| :- | :- |
| `Right` | `Right` |
| `Options` | extends [`ViewJoinOptions`](/api/modules/browser#viewjoinoptions) |

#### Parameters

| Name | Type |
| :- | :- |
| `right` | [`RelationalQuery`](/api/classes/browser.RelationalQuery)\<`Right`> |
| `options` | `Options` |

#### Returns

[`RelationalQuery`](/api/classes/browser.RelationalQuery)\<[`Join`](/api/modules/browser#join)\<`Expr`, `Right`, `"left"`, `Options`>>

***

### innerJoin

▸ **innerJoin**\<`Right`, `Options`>(`right`, `options`): [`RelationalQuery`](/api/classes/browser.RelationalQuery)\<[`Join`](/api/modules/browser#join)\<`Expr`, `Right`, `"inner"`, `Options`>>

#### Type parameters

| Name | Type |
| :- | :- |
| `Right` | `Right` |
| `Options` | extends [`ViewJoinOptions`](/api/modules/browser#viewjoinoptions) |

#### Parameters

| Name | Type |
| :- | :- |
| `right` | [`RelationalQuery`](/api/classes/browser.RelationalQuery)\<`Right`> |
| `options` | `Options` |

#### Returns

[`RelationalQuery`](/api/classes/browser.RelationalQuery)\<[`Join`](/api/modules/browser#join)\<`Expr`, `Right`, `"inner"`, `Options`>>

***

### aggregate

▸ **aggregate**\<`Name`, `From`, `Aggregates`>(`alias`, `options`): [`RelationalQuery`](/api/classes/browser.RelationalQuery)\<[`Aggregate`](/api/modules/browser#aggregate)\<`Expr`, `Name`, `From`, `Aggregates`>>

#### Type parameters

| Name | Type |
| :- | :- |
| `Name` | extends `string` |
| `From` | `From` |
| `Aggregates` | extends `Record`\<`string`, [`ViewAggregate`](/api/modules/browser#viewaggregate)> |

#### Parameters

| Name | Type |
| :- | :- |
| `alias` | `Name` |
| `options` | `Object` |

#### Returns

[`RelationalQuery`](/api/classes/browser.RelationalQuery)\<[`Aggregate`](/api/modules/browser#aggregate)\<`Expr`, `Name`, `From`, `Aggregates`>>

***

### groupBy

▸ **groupBy**\<`Fields`>(`fields`, `window?`): `Object`

#### Type parameters

| Name | Type |
| :- | :- |
| `Fields` | extends readonly `string`\[] |

#### Parameters

| Name | Type |
| :- | :- |
| `fields` | `Fields` |
| `window?` | [`ViewWindow`](/api/modules/browser#viewwindow) |

#### Returns

`Object`

| Name | Type |
| :- | :- |
| `aggregate` | \<Aggregates>(`aggregates`: `Aggregates`) => [`RelationalQuery`](/api/classes/browser.RelationalQuery)\<[`Group`](/api/modules/browser#group)\<`Expr`, `Fields`, `Aggregates`>> |

***

### orderBy

▸ **orderBy**(`keys`): [`RelationalQuery`](/api/classes/browser.RelationalQuery)\<[`Sort`](/api/modules/browser#sort)\<`Expr`>>

#### Parameters

| Name | Type |
| :- | :- |
| `keys` | readonly (`string` \| [`ViewSortKey`](/api/modules/browser#viewsortkey))\[] |

#### Returns

[`RelationalQuery`](/api/classes/browser.RelationalQuery)\<[`Sort`](/api/modules/browser#sort)\<`Expr`>>

***

### limit

▸ **limit**(`rows`): [`RelationalQuery`](/api/classes/browser.RelationalQuery)\<[`Sort`](/api/modules/browser#sort)\<`Expr`>>

#### Parameters

| Name | Type |
| :- | :- |
| `rows` | `number` |

#### Returns

[`RelationalQuery`](/api/classes/browser.RelationalQuery)\<[`Sort`](/api/modules/browser#sort)\<`Expr`>>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.