pub struct ShowSyntax {Show 13 fields
pub describe: bool,
pub describe_summarize: bool,
pub session_statements: bool,
pub set_value_reserved_words: KeywordSet,
pub set_value_on_keyword: bool,
pub set_value_null_keyword: bool,
pub show_tables: bool,
pub show_columns: bool,
pub show_create_table: bool,
pub show_functions: bool,
pub show_routine_status: bool,
pub show_verbose: bool,
pub show_admin: bool,
}Expand description
Dialect-owned SHOW/DESCRIBE introspection-statement syntax accepted by the parser.
The session SHOW/SET/RESET reader, the typed SHOW <object> catalogue
listings, and the MySQL/DuckDB DESCRIBE/SUMMARIZE introspection statements. Split
out of UtilitySyntax at its 16-field line as the introspection axis. Each flag is a
leading-keyword dispatch gate: when off the keyword is not dispatched and surfaces as
an unknown statement (or the typed-SHOW lookahead falls through to the session reader).
Statement-head gates are consumed by parser::statement_dispatch; parse bodies live
in the SHOW/session family modules.
Fields§
§describe: boolAccept MySQL’s DESCRIBE/DESC keywords as EXPLAIN synonyms and the MySQL
{DESCRIBE | DESC | EXPLAIN} <table> [<column> | '<pattern>'] table-metadata
overload. MySQL-only (and the permissive superset). When on: the leading DESCRIBE
and DESC keywords are dispatched into the EXPLAIN grammar (spelling recorded on
ExplainStatement), and all three EXPLAIN-family
keywords additionally accept a table name in place of an explainable statement
(yielding a DescribeStatement). When off
(ANSI/PostgreSQL/SQLite): DESCRIBE/DESC are not statement leaders and EXPLAIN
keeps its plain query-plan-only grammar, so a table after EXPLAIN is rejected as
PostgreSQL does. EXPLAIN itself stays ungated (accepted everywhere).
describe_summarize: boolAccept DuckDB’s leading-keyword {DESCRIBE | SUMMARIZE} <query> | <table>
introspection statement (Statement::ShowRef).
DuckDB desugars it to SELECT * FROM (<SHOW_REF>), so it reuses the same SHOW_REF
core (ShowRef) as the parenthesized table factor, only at
statement-leading position. DuckDB-only (and the permissive superset).
Distinct from describe: that flag is MySQL’s overload of the
EXPLAIN keyword (DESCRIBE as a query-plan synonym, plus the <table> [<column>]
metadata form) and never touches SUMMARIZE; this one is DuckDB’s SHOW_REF
utility, whose DESCRIBE/SUMMARIZE return the target’s schema / summary statistics
as a relation. The two share the DESCRIBE leader but are not a
GrammarConflict: every real-dialect preset enables at most one, and Lenient — the
one preset with both on — resolves the shared leader deterministically by dispatch
order (DESCRIBE/DESC route to the MySQL EXPLAIN synonym above; only SUMMARIZE
reaches this SHOW_REF utility), a conflict-free permissive union rather than a mutual
exclusion, so no registry variant governs it. Boundary with
TableFactorSyntax::show_ref:
that flag owns the same core inside a FROM (…) table factor; this one owns the
statement-leading spelling — one production, two grammar positions, one flag each.
session_statements: boolAccept the session statements SET <var> … / RESET … / SHOW … (PostgreSQL/
MySQL; the standard SET CONSTRAINTS/SET SESSION CHARACTERISTICS also route
here). On for ANSI/PostgreSQL/MySQL/DuckDB/Lenient. SQLite has no session-variable
statement, so it is off; the leading keyword is then not dispatched and surfaces as
an unknown statement. SET TRANSACTION is transaction control (claimed earlier in
dispatch), so it is unaffected by this gate.
set_value_reserved_words: KeywordSetKeywords rejected as unquoted values in the generic
SET <parameter> {= | TO} <value> [, ...] grammar. String and numeric literals,
ordinary identifiers, and non-reserved keywords remain accepted. PostgreSQL’s
var_value production and DuckDB’s corresponding grammar both enforce this
boundary; permissive compatibility dialects may accept any keyword.
set_value_on_keyword: boolAccept the otherwise-reserved ON keyword as a generic SET value.
PostgreSQL names ON explicitly in opt_boolean_or_string; DuckDB does not.
TRUE and FALSE are accepted independently as boolean values whenever reserved
words are rejected.
set_value_null_keyword: boolAccept the otherwise-reserved NULL keyword as a generic SET value. DuckDB
accepts this spelling; PostgreSQL’s var_value production does not.
show_tables: boolAccept the typed SHOW [EXTENDED] [FULL] [ALL] TABLES [{FROM | IN} <db>] [LIKE '<pat>' | WHERE <expr>] catalogue-listing statement
(Statement::Show). On for MySQL/DuckDB/Lenient;
off for ANSI/PostgreSQL/SQLite.
This is a refinement of the generic-SHOW dispatch, so its boundary with the
two other SHOW seams is MECE:
session_statementsowns the generic top-levelSHOW <var>that reads one configuration parameter. Whenshow_tablesis on, a top-levelSHOWwhose next word (past the optionalEXTENDED/FULL/ALLmodifiers) isTABLESis claimed here instead; every otherSHOW <var>still falls through to the session statement. So PostgreSQL (this flag off) keeps parsingSHOW tablesas a generic sessionSHOW— the parse it already accepts — and only MySQL/DuckDB reinterpret theTABLESkeyword as the catalogue listing.TableFactorSyntax::show_refowns the parenthesized(SHOW <name>)/(DESCRIBE …)table factor that only appears inside aFROM (…)and yields a relation; it never reaches the statement-leading position this flag governs.
One flag per typed-SHOW subform (the sibling SHOW COLUMNS/SHOW CREATE TABLE/
SHOW FUNCTIONS tickets add their own), because their per-dialect availability
differs — the copy/comment_on separate-flags precedent. Once on, the single
flag admits the whole modifier union permissively (MySQL’s FULL/LIKE/WHERE,
DuckDB’s ALL), the DESCRIBE/PRAGMA single-flag-utility precedent — the corpus
verdict gate catches only corpus-present over-acceptance.
show_columns: boolAccept the typed SHOW [EXTENDED] [FULL] {COLUMNS | FIELDS} {FROM | IN} <tbl> [{FROM | IN} <db>] [LIKE '<pat>' | WHERE <expr>] column-listing statement
(Statement::Show with
ShowTarget::Columns). On for MySQL/Lenient only; off for
ANSI/PostgreSQL/SQLite/DuckDB.
A separate gate from show_tables because its per-dialect
availability differs: DuckDB accepts SHOW [ALL] TABLES but has no SHOW COLUMNS
grammar at all (every SHOW {COLUMNS | FIELDS} … form is ER_PARSE_ERROR on DuckDB
1.5.4, engine-probed — it uses DESCRIBE / SHOW <table> instead), so a shared flag
would over-accept there. Same MECE refinement of the generic-SHOW dispatch as
show_tables: a top-level SHOW whose next word past the optional EXTENDED/FULL
modifiers is COLUMNS or the FIELDS synonym is claimed here; every other
SHOW <var> still falls through to session_statements,
and the parenthesized (SHOW <name>)
show_ref table factor is
untouched. Once on, the single flag admits the whole MySQL modifier/filter union
permissively (the DESCRIBE/PRAGMA single-flag-utility precedent).
show_create_table: boolAccept the typed SHOW CREATE TABLE <tbl> statement — the CREATE TABLE DDL that
would recreate the named table (Statement::Show with
ShowTarget::Create and
ShowCreateKind::Table). On for MySQL/Lenient only; off
for ANSI/PostgreSQL/SQLite/DuckDB. The other SHOW CREATE <kind> object kinds ride
show_admin.
A separate gate from show_tables/show_columns
because its per-dialect availability differs: MySQL has SHOW CREATE TABLE but DuckDB
has no such grammar (it uses SELECT sql FROM duckdb_tables / .schema), so a shared
flag would over-accept there. Same MECE refinement of the generic-SHOW dispatch: a
top-level SHOW whose next two words are CREATE TABLE is claimed here; a bare
SHOW create (the two-keyword lookahead requires TABLE to follow) and every other
SHOW <var> still fall through to session_statements,
so PostgreSQL’s generic SHOW <var> reading create as the variable name is
undisturbed. There are no EXTENDED/FULL modifiers on this subform (MySQL docs).
Only the TABLE object kind is modelled; SHOW CREATE {DATABASE | VIEW | …} is
deferred to sibling tickets.
show_functions: boolAccept the typed SHOW [{USER | SYSTEM | ALL}] FUNCTIONS [{FROM | IN} <schema>] [[LIKE] {<function_name> | '<regex>'}] function-listing statement
(Statement::Show with
ShowTarget::Functions). On for Databricks/Lenient only;
off for ANSI/PostgreSQL/MySQL/SQLite/DuckDB.
A separate gate from the other show_* subforms because its per-dialect
availability differs — and it is the first typed-SHOW flag on under Databricks,
where the other three are off. Spark/Databricks are the only shipped engines with a
bare SHOW FUNCTIONS listing (doc-cited grammar); MySQL’s SHOW FUNCTION STATUS is
a different routine-catalogue statement (deferred to its own ticket), and DuckDB
has no SHOW FUNCTIONS grammar at all — SHOW <name> there is a DESCRIBE alias,
so SHOW functions describes a table named functions (engine-probed on 1.5.4), a
generic-SHOW reinterpretation a shared flag would corrupt. Same MECE refinement of
the generic-SHOW dispatch: a top-level SHOW whose next word (past the optional
USER/SYSTEM/ALL scope) is FUNCTIONS is claimed here; a bare SHOW <var>
(including SHOW ALL with no FUNCTIONS) still falls through to
session_statements. Once on, the single flag admits the
whole modifier/filter union permissively (the DESCRIBE/PRAGMA single-flag-utility
precedent).
show_routine_status: boolAccept the typed SHOW {FUNCTION | PROCEDURE} STATUS [LIKE '<pat>' | WHERE <expr>]
stored-routine catalogue listing
(Statement::Show with
ShowTarget::RoutineStatus). On for MySQL/Lenient only;
off for ANSI/PostgreSQL/SQLite/DuckDB/Databricks.
A separate gate from show_functions because it is a
different statement, not the same one under another dialect: MySQL’s routine
catalogue takes the singular FUNCTION/PROCEDURE object keyword plus a mandatory
STATUS and lists a row per stored routine, where the Spark/Databricks
show_functions listing takes the bare plural FUNCTIONS and lists function names.
Their per-dialect availability is disjoint (MySQL rejects SHOW FUNCTIONS,
Databricks rejects SHOW FUNCTION STATUS), so a shared flag would over-accept in
both directions — the one-flag-per-typed-SHOW-subform precedent. Same MECE
refinement of the generic-SHOW dispatch as the sibling gates: a top-level SHOW
whose next two words are FUNCTION STATUS or PROCEDURE STATUS is claimed here. The
two-keyword lookahead steals only that full prefix; FUNCTION/PROCEDURE are reserved
keywords, so a bare SHOW FUNCTION cannot be a generic session SHOW <var> (like
SHOW CREATE, it is a parse error both ways), and every other SHOW <var> still falls
through to session_statements. There is no scope keyword and
no {FROM | IN} qualifier — SHOW FUNCTION STATUS FROM db is ER_PARSE_ERROR on
mysql:8 (engine-probed) — only the optional LIKE/WHERE narrowing, which reuses the
shared ShowFilter.
show_verbose: boolAccept the trailing VERBOSE on a generic session SHOW — SHOW ALL VERBOSE,
SHOW <setting> VERBOSE — carried on
SessionStatement::Show::verbose. On for Lenient
only; off for every oracle-backed dialect.
VERBOSE here is the sqlparser-rs/DataFusion planner spelling, not a database
grammar: pg_query and DuckDB both reject SHOW ALL VERBOSE and
SHOW <setting> VERBOSE (engine-probed), so no dialect with a real oracle can turn
it on without diverging. It refines only the session SHOW seam and never the
typed-SHOW dispatch: the TABLES/COLUMNS/CREATE TABLE/FUNCTIONS lookaheads
each insist on their keyword after the modifiers, so SHOW ALL VERBOSE (no
TABLES) falls through to the session branch and SHOW ALL TABLES stays typed —
the seams remain MECE. A behaviour-named tail flag, not gated on
session_statements: where session SHOW is off
(SQLite) the keyword is never dispatched, so this flag is inert there regardless.
show_admin: boolAccept the MySQL server-administration / catalogue-introspection SHOW sub-command
family — the ~40 SHOW productions beyond the individually-gated
TABLES/COLUMNS/CREATE TABLE/{FUNCTION|PROCEDURE} STATUS subforms:
SHOW DATABASES, SHOW [GLOBAL|SESSION] {STATUS|VARIABLES}, SHOW PLUGINS,
SHOW [STORAGE] ENGINES, SHOW ENGINE <e> {STATUS|MUTEX|LOGS}, SHOW PRIVILEGES,
SHOW {CHARACTER SET|CHARSET}, SHOW COLLATION, SHOW EVENTS, SHOW TABLE STATUS,
SHOW OPEN TABLES, SHOW [FULL] TRIGGERS, SHOW [FULL] PROCESSLIST,
SHOW CREATE {VIEW|DATABASE|EVENT|PROCEDURE|FUNCTION|TRIGGER} <name>,
SHOW [EXTENDED] {INDEX|INDEXES|KEYS} FROM <t>, SHOW GRANTS,
SHOW {WARNINGS|ERRORS} [LIMIT …] / SHOW COUNT(*) {WARNINGS|ERRORS},
SHOW BINARY LOGS, SHOW REPLICAS, SHOW BINARY LOG STATUS,
SHOW REPLICA STATUS [FOR CHANNEL …], SHOW PROFILES, and
SHOW {PROCEDURE|FUNCTION} CODE <name> (all → Statement::Show).
On for MySQL/Lenient only; off for every other preset.
This is a single behaviour flag for the whole family rather than one flag per
sub-command (the show_tables/show_columns precedent) because, unlike those, this
family’s per-dialect availability does not vary — every member is MySQL-only and they
travel together; the sub-command identity is DATA (the ShowTarget
Listing/Bare/Create/Index/Engine/… axis), not a separate behaviour axis.
The parser reaches it through one table-driven dispatch (parse_show_admin_statement),
not one arm per keyword. Same MECE refinement of the generic-SHOW dispatch as the
sibling gates: the lookahead insists on one of the family’s lead keywords, so any
other SHOW <var> still falls through to
session_statements. The gate also covers the
grammatically heavier subforms with operands (SHOW GRANTS FOR <user> [USING …],
SHOW CREATE USER, SHOW PROFILE, SHOW {BINLOG | RELAYLOG} EVENTS); when off, every
family keyword falls through unclaimed.
Implementations§
Source§impl ShowSyntax
impl ShowSyntax
Source§impl ShowSyntax
impl ShowSyntax
Sourcepub const DATABRICKS: Self
Available on crate feature databricks only.
pub const DATABRICKS: Self
databricks only.The DATABRICKS preset for show syntax.
Source§impl ShowSyntax
impl ShowSyntax
Source§impl ShowSyntax
impl ShowSyntax
Source§impl ShowSyntax
impl ShowSyntax
Source§impl ShowSyntax
impl ShowSyntax
Source§impl ShowSyntax
impl ShowSyntax
Trait Implementations§
Source§impl Clone for ShowSyntax
impl Clone for ShowSyntax
Source§fn clone(&self) -> ShowSyntax
fn clone(&self) -> ShowSyntax
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more