gizmodel/sql/parsegrant
The SQL parser: roles, GRANT, REVOKE and policies.
import * as Parsegrant from "gizmodel/sql/parsegrant";Methods
Parser.roleOptions
function Parser.roleOptions(self: mut Parser): stringThe options of CREATE or ALTER ROLE as name=value lines: LOGIN, SUPERUSER, CREATEROLE (and their NO forms), PASSWORD 'x' or NULL, IN ROLE a, b; Oracle's IDENTIFIED BY x and SQL Server's WITH PASSWORD = 'x' too. Other options (CREATEDB, INHERIT, CONNECTION LIMIT, VALID UNTIL) change nothing here.
Effects: fail, alloc.
Parser.grant
function Parser.grant(self: mut Parser, op: string): StatementGRANT privileges ON [TABLE] t, ... | ON ALL TABLES IN SCHEMA s TO grantee, ... and GRANT
role, ... TO role, ...; REVOKE likewise FROM. what: table, all_tables or role; columns: the
tables or roles granted; text: the privilege words; options: the grantees.
Effects: fail, read, alloc.
Parser.policy
function Parser.policy(self: mut Parser): StatementCREATE POLICY name ON t [AS PERMISSIVE|RESTRICTIVE] [FOR command] [TO roles] [USING (x)]
[WITH CHECK (x)]: method the command, options the roles, unique restrictive, text the
USING expression's SQL and action WITH CHECK's.
Effects: fail, read, alloc.