GizStackGizStack
View .mdOpen in ChatGPTOpen in Claude

gizmodel/sql/parseexpr

The SQL parser: expressions, calls, windows and grouping sets.

gizlang
import * as Parseexpr from "gizmodel/sql/parseexpr";

Methods

Parser.expression

gizlang
function Parser.expression(self: mut Parser): Expr

Parses one expression.

Effects: fail, read, alloc.

Parser.bitOr

gizlang
function Parser.bitOr(self: mut Parser): Expr

Effects: fail, read, alloc.

Parser.additive

gizlang
function Parser.additive(self: mut Parser): Expr

Effects: fail, read, alloc.

Parser.returningItems

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

RETURNING items. Oracle's INTO :bind list reaches here only when the client sent no binds (db/ora cuts it off before it parses a statement): ORA-01008.

Effects: fail, read, alloc.

Parser.unary

gizlang
function Parser.unary(self: mut Parser): Expr

Effects: fail, read, alloc.

Parser.brackets

gizlang
function Parser.brackets(self: mut Parser): Expr

The subscripts [i], [i:j], [:j], [i:] that follow: an expression whose args are a lower and an upper bound for each (an element's twice, an open bound ±2^62) and whose name has "e" (an element) or "s" (a slice) for each.

Effects: fail, read, alloc.

Parser.primary

gizlang
function Parser.primary(self: mut Parser): Expr

A primary expression; it reports the position of its first token.

Effects: fail, read, alloc.

Parser.argument

gizlang
function Parser.argument(self: mut Parser): Expr

A call argument: name => x or name := x is the "named" node of x, which the routine's parameter list places (proc.giz positional).

Effects: fail, read, alloc.

Parser.windowSpec

gizlang
function Parser.windowSpec(self: mut Parser): Window

Effects: fail, read, alloc.

Parser.count

gizlang
function Parser.count(self: mut Parser): string

A signed integer count, as its text (FETCH, MOVE).

Effects: fail, alloc.

Parser.storageOptions

gizlang
function Parser.storageOptions(self: mut Parser): string

(name [= value], ...): storage parameters as "name=value" lines ("name" alone without a value); a name may carry a namespace (toast.name).

Effects: fail, alloc.

Parser.relOptionsAction

gizlang
function Parser.relOptionsAction(self: mut Parser, s: mut Statement): void

SET (options) or RESET (names) of ALTER TABLE or ALTER INDEX: actions set_options and reset_options.

Effects: fail, alloc.

Parser.skipAction

gizlang
function Parser.skipAction(self: mut Parser): void

Skips the rest of one ALTER TABLE action: up to a comma outside parentheses or the statement's end.

Effects: fail.

Parser.insertTargets

gizlang
function Parser.insertTargets(self: mut Parser): Vec<Target>

Effects: fail, read, alloc.

Parser.targetSubscripts

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

Effects: fail, read, alloc.

Parser.tablesample

gizlang
function Parser.tablesample(self: mut Parser): void

TABLESAMPLE method (args) [REPEATABLE (seed)]: every row is read; a sample is a subset of them.

Effects: fail.

Parser.currentOf

gizlang
function Parser.currentOf(self: mut Parser): Expr

The condition after WHERE: CURRENT OF cursor, or an expression.

Effects: fail, read, alloc.