gizmodel/sql/parsecatalog
The SQL parser: catalog objects, event triggers, publications and DROP.
import * as Parsecatalog from "gizmodel/sql/parsecatalog";Methods
Parser.tableQuery
function Parser.tableQuery(self: mut Parser, s: mut Statement): voidCREATE TABLE ... AS's query: a SELECT, or EXECUTE name(args) of a prepared statement (in inner; the server puts the
statement in), then WITH [NO] DATA.
Effects: fail, read, alloc.
Parser.catalogObject
function Parser.catalogObject(self: mut Parser, verb: string, kind: string): StatementCREATE, ALTER or DROP (verb) of a catalog object of kind (catalogKind): op "catalog". name,
DROP's further names in columns, RENAME TO's new name in columns, the definition in text;
the tables it names (CREATE STATISTICS ... FROM t) in inherits; a publication by Parser.publication.
Effects: fail, read, alloc.
Parser.alterSequence
function Parser.alterSequence(self: mut Parser): StatementALTER SEQUENCE: op "alter_sequence"; columns holds the changes as key=value (restart, start, increment,
minvalue, maxvalue, cycle, as; an empty value is the default), or action rename with the new name in text.
Effects: fail, alloc.
Parser.roleNames
function Parser.roleNames(self: mut Parser): Vec<string>Role names separated by commas, lower case unless quoted.
Effects: fail, alloc.
Parser.drop
function Parser.drop(self: mut Parser): StatementEffects: fail, read, alloc.
Parser.ownerTo
function Parser.ownerTo(self: Parser): stringThe role of a trailing OWNER TO r, lower case unless quoted; "" when there is none or it is the current role.
Effects: fail, alloc.