# gizmodel/sql/parsequery

The SQL parser: queries: WITH, set operations, SELECT, FROM, joins and pivots.

```gizlang
import * as Parsequery from "gizmodel/sql/parsequery";
```

## Methods

### `Parser.query`

```gizlang
function Parser.query(self: mut Parser): Select
```

A full query: WITH, set operations, ORDER BY, LIMIT/OFFSET/FETCH.

Effects: fail, read, alloc.

### `Parser.withList`

```gizlang
function Parser.withList(self: mut Parser): Vec<Cte>
```

The CTEs after WITH.

Effects: fail, read, alloc.

### `Parser.items`

```gizlang
function Parser.items(self: mut Parser): Vec<Item>
```

Effects: fail, read, alloc.

### `Parser.orderList`

```gizlang
function Parser.orderList(self: mut Parser): Vec<Order>
```

Effects: fail, read, alloc.

### `Parser.fromList`

```gizlang
function Parser.fromList(self: mut Parser): Vec<From>
```

Effects: fail, read, alloc.

### `Parser.joined`

```gizlang
function Parser.joined(self: mut Parser): From
```

Effects: fail, read, alloc.

### `Parser.pivotNext`

```gizlang
function Parser.pivotNext(self: Parser): bool
```

Whether PIVOT ( or UNPIVOT [INCLUDE | EXCLUDE NULLS] ( comes next.

Effects: fail.

### `Parser.exprRow`

```gizlang
function Parser.exprRow(self: mut Parser): Vec<Expr>
```

One expression or a parenthesized list of them (a row of an IN list).

Effects: fail, read, alloc.

