gizmodel/sql/parsecolumn
The SQL parser: columns, constraints, sequences and type names.
import * as Parsecolumn from "gizmodel/sql/parsecolumn";Methods
Parser.signedInt
function Parser.signedInt(self: mut Parser): i64Effects: fail, alloc.
Parser.skipParens
function Parser.skipParens(self: mut Parser): voidEffects: fail.
Parser.indexColumn
function Parser.indexColumn(self: mut Parser): Vec<string>An index column: its name and an operator class naming a vector metric, if any. Expressions other than a column are not indexed.
Effects: fail, alloc.
Parser.tableConstraint
function Parser.tableConstraint(self: mut Parser): ConstraintEffects: fail, read, alloc.
Parser.nullsDistinct
function Parser.nullsDistinct(self: mut Parser): stringNULLS [NOT] DISTINCT of a unique key: "nulls not distinct" when its NULLs are equal, else "".
Effects: fail, alloc.
Parser.rawParens
function Parser.rawParens(self: mut Parser): stringThe text between a pair of parentheses, as written (any tokens).
Effects: fail, alloc.
Parser.sequenceOptions
function Parser.sequenceOptions(self: mut Parser): stringA sequence's options (CREATE SEQUENCE, an identity column's): START, INCREMENT, MINVALUE, MAXVALUE, CYCLE as the sequence's text (sequence.giz sequenceText); CACHE, ORDER, AS, OWNED BY and SEQUENCE NAME change nothing.
Effects: fail, alloc.
Parser.identitySpec
function Parser.identitySpec(self: mut Parser): stringGENERATED {ALWAYS | BY DEFAULT [ON NULL]} AS IDENTITY [(options)] after GENERATED: "a", "d" or "n" (ON NULL: a given NULL takes the next value too), then "\u0001" and the sequence's text when options are given.
Effects: fail, alloc.
Parser.columnSpec
function Parser.columnSpec(self: mut Parser): ColumnSpecEffects: fail, read, alloc.
Parser.typeName
function Parser.typeName(self: mut Parser): stringEffects: fail, alloc.
Parser.userMapping
function Parser.userMapping(self: Parser): boolWhether the next words are USER MAPPING (a catalog object, not a role).
Effects: fail, alloc.
Parser.catalogKind
function Parser.catalogKind(self: mut Parser): stringThe kind of a PostgreSQL object GizDB keeps in its catalog but does not use, as CREATE, ALTER and DROP name it ("" when the next words name none).
Effects: fail, alloc.