pub enum ShowTarget<X: Extension = NoExt> {
Show 16 variants
Tables {
extended: bool,
full: bool,
all: bool,
from: Option<ShowFrom>,
filter: Option<ShowFilter<X>>,
meta: Meta,
},
Columns {
extended: bool,
full: bool,
spelling: ShowColumnsSpelling,
table: ShowFrom,
database: Option<ShowFrom>,
filter: Option<ShowFilter<X>>,
meta: Meta,
},
Create {
kind: ShowCreateKind,
name: ObjectName,
if_not_exists: bool,
meta: Meta,
},
Functions {
kind: Option<ShowFunctionsScope>,
from: Option<ShowFrom>,
filter: Option<ShowFunctionsFilter>,
meta: Meta,
},
RoutineStatus {
kind: ShowRoutineKind,
filter: Option<ShowFilter<X>>,
meta: Meta,
},
Listing {
kind: ShowListing,
from: Option<ShowFrom>,
filter: Option<ShowFilter<X>>,
meta: Meta,
},
Bare {
kind: ShowBare,
meta: Meta,
},
Grants {
user: Option<AccountName>,
using_roles: ThinVec<AccountName>,
meta: Meta,
},
CreateUser {
user: AccountName,
meta: Meta,
},
Profile {
types: ThinVec<ShowProfileType>,
query: Option<Literal>,
limit: Option<ShowLimit>,
meta: Meta,
},
LogEvents {
relay: bool,
log_name: Option<Literal>,
position: Option<Literal>,
limit: Option<ShowLimit>,
channel: Option<Literal>,
meta: Meta,
},
Index {
spelling: ShowIndexSpelling,
extended: bool,
table: ShowFrom,
database: Option<ShowFrom>,
filter: Option<ShowFilter<X>>,
meta: Meta,
},
Engine {
engine: Option<Ident>,
artifact: ShowEngineArtifact,
meta: Meta,
},
ReplicaStatus {
channel: Option<Literal>,
meta: Meta,
},
Diagnostics {
kind: ShowDiagnosticKind,
count: bool,
limit: Option<ShowLimit>,
meta: Meta,
},
RoutineCode {
kind: ShowRoutineKind,
name: ObjectName,
meta: Meta,
},
}Expand description
What a ShowStatement lists — the extensible axis of the typed-SHOW family.
The cross-dialect subforms Tables, Columns,
Functions, and RoutineStatus each carry a
genuinely distinct payload (see ShowStatement for why this is a per-variant enum
rather than a flat kind tag). The MySQL server-administration / catalogue family folds
its ~40 near-identical sub-commands onto data axes instead: Listing
and Bare carry a sub-command discriminator, Create a
ShowCreateKind, and Index, Engine,
ReplicaStatus, Diagnostics, and
RoutineCode the handful with their own operands. The account /
diagnostics remainder rides its own operand-bearing variants: Grants and
CreateUser (the shared AccountName user grammar),
Profile (a resource-type list plus FOR QUERY / LIMIT), and
LogEvents (the BINLOG / RELAYLOG event dump).
Variants§
Tables
SHOW [EXTENDED] [FULL] [ALL] TABLES [{FROM | IN} <db>] [LIKE '<pat>' | WHERE <expr>].
The leading modifiers are dialect-split unions: EXTENDED/FULL are MySQL’s
(SHOW FULL TABLES adds a table-type column), ALL is DuckDB’s (SHOW ALL TABLES
lists every attached database’s tables). Each is an independent optional keyword,
so they ride separate bools rather than one axis; no shipped dialect mixes them.
The {FROM | IN} <db> qualifier and the LIKE/WHERE filter are MySQL’s (DuckDB
accepts only FROM <schema>); the single show_tables
gate accepts the union permissively, the DESCRIBE/PRAGMA single-flag-utility precedent.
Fields
filter: Option<ShowFilter<X>>The optional trailing LIKE '<pat>' / WHERE <expr> narrowing.
Columns
SHOW [EXTENDED] [FULL] {COLUMNS | FIELDS} {FROM | IN} <tbl> [{FROM | IN} <db>] [LIKE '<pat>' | WHERE <expr>] (MySQL; gated by
show_columns).
Unlike Tables, the {FROM | IN} qualifier is mandatory — it
names the table whose columns are listed — and the grammar has a second, optional
{FROM | IN} <db> naming the database (equivalent to writing db.tbl in the
table slot). There is no ALL modifier here; DuckDB has
no SHOW COLUMNS grammar at all (engine-probed reject on 1.5.4), so this is a
MySQL-only subform. FIELDS is an exact synonym of COLUMNS; the written spelling
rides the ShowColumnsSpelling surface tag so the statement round-trips.
Fields
spelling: ShowColumnsSpellingWhich keyword named the listing: COLUMNS or its FIELDS synonym.
filter: Option<ShowFilter<X>>The optional trailing LIKE '<pat>' / WHERE <expr> narrowing.
Create
SHOW CREATE {TABLE | VIEW | DATABASE [IF NOT EXISTS] | EVENT | PROCEDURE | FUNCTION | TRIGGER} <name> — the DDL that would recreate the named object (MySQL). The
TABLE spelling is gated by
show_create_table; every other
object kind is gated by show_admin.
The object kind rides the kind axis as DATA rather than
forcing one bespoke variant per keyword — the SHOW CREATE … subforms are
structurally identical (two fixed keywords plus one schema-qualifiable name), so a
per-keyword variant would be pure duplication. IF NOT EXISTS is a DATABASE-only
guard (if_not_exists, always false for the other
kinds). SHOW CREATE USER is deliberately excluded: its operand is a MySQL user
specification ('user'@'host'), not an ObjectName, so it rides its own
CreateUser variant over the shared AccountName grammar.
Fields
kind: ShowCreateKindWhich object kind followed CREATE; see ShowCreateKind.
name: ObjectNameThe target object name (schema-qualifiable).
Functions
SHOW [{USER | SYSTEM | ALL}] FUNCTIONS [{FROM | IN} <schema>] [[LIKE] {<function_name> | '<regex>'}] (Spark / Databricks; gated by
show_functions).
The only shipped engine with a bare SHOW FUNCTIONS listing is Spark/Databricks,
and it carries the full grammar: an optional kind scope
keyword (USER/SYSTEM/ALL) before FUNCTIONS, an optional {FROM | IN}
schema qualifier, and an optional trailing name-or-regex narrowing whose LIKE
keyword is itself optional. MySQL’s SHOW FUNCTION STATUS is a different
statement (a routine catalogue over mysql.proc, not a bare SHOW FUNCTIONS) —
modelled by its own RoutineStatus variant; DuckDB has no
SHOW FUNCTIONS grammar (SHOW <name> there is a DESCRIBE alias — SHOW functions describes a table named functions, engine-probed on 1.5.4).
Fields
kind: Option<ShowFunctionsScope>The optional USER / SYSTEM / ALL scope keyword written before FUNCTIONS.
filter: Option<ShowFunctionsFilter>The optional trailing [LIKE] {<function_name> | '<regex>'} narrowing.
RoutineStatus
SHOW {FUNCTION | PROCEDURE} STATUS [LIKE '<pat>' | WHERE <expr>] — the stored-routine
catalogue listing (MySQL; gated by
show_routine_status).
A different statement from the Spark/Databricks Functions
listing: different keywords (the singular FUNCTION/PROCEDURE plus a mandatory
STATUS, not a bare plural FUNCTIONS) and a different payload (a row per stored
routine from information_schema.routines, not the bare function names). It carries
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 (MySQL’s mutually-exclusive LIKE '<pat>' | WHERE <expr>, exactly as SHOW TABLES/SHOW COLUMNS). The FUNCTION
vs PROCEDURE object keyword rides the ShowRoutineKind surface tag so the
statement round-trips.
Fields
kind: ShowRoutineKindWhich stored-routine kind was named: FUNCTION or PROCEDURE.
filter: Option<ShowFilter<X>>The optional trailing LIKE '<pat>' / WHERE <expr> narrowing.
Listing
A MySQL catalogue/server listing that admits the shared [LIKE '<pat>' | WHERE <expr>] tail — SHOW DATABASES, SHOW EVENTS, SHOW [GLOBAL | SESSION] STATUS,
SHOW TRIGGERS, and their siblings (gated by
show_admin).
The sub-command rides the kind axis as DATA: every member
shares the trailing ShowFilter, the members that accept an optional {FROM | IN} <db> qualifier share from, and each sub-command’s own
small scalar payload (a GLOBAL/SESSION scope, a FULL flag, a spelling bit)
rides the ShowListing discriminator, so the many near-identical listings collapse
into one node instead of one bespoke variant each. The single from
admits the qualifier permissively (SHOW DATABASES/SHOW STATUS take none — the
parser leaves those None), the DESCRIBE/PRAGMA single-field precedent.
Fields
kind: ShowListingWhich listing was named, plus its sub-command-specific scalar payload; see
ShowListing.
from: Option<ShowFrom>The optional {FROM | IN} <db> schema qualifier (only EVENTS, TABLE STATUS,
OPEN TABLES, and TRIGGERS accept one; None for every other member).
filter: Option<ShowFilter<X>>The optional trailing LIKE '<pat>' / WHERE <expr> narrowing.
Bare
A MySQL SHOW sub-command that takes no filter and no name operand — SHOW PLUGINS,
SHOW [STORAGE] ENGINES, SHOW PRIVILEGES, SHOW [FULL] PROCESSLIST, SHOW BINARY LOGS, and their siblings (gated by
show_admin).
The sub-command rides the kind axis as DATA; the only payloads
any member carries are single leading-keyword flags (STORAGE before ENGINES,
FULL before PROCESSLIST), folded into the ShowBare variant.
Fields
Grants
SHOW GRANTS [FOR <user> [USING <role> [, …]]] — the privilege listing for an account
(MySQL; gated by show_admin).
Bare SHOW GRANTS (the session’s own privileges) leaves user
None and using_roles empty. FOR <user> names the
account whose grants are shown; the optional USING <role list> (only valid after
FOR — SHOW GRANTS USING … is ER_PARSE_ERROR on mysql:8.4.10) restricts the
listing to the named active roles. Both the user and each role are the shared
AccountName user grammar (a named 'u'@'host' account or CURRENT_USER [()]),
so this reuses the account-reference axis the DCL landings build. using_roles is
non-empty only when USING was written, which the grammar allows only when
user is Some.
Fields
user: Option<AccountName>The FOR <user> account, or None for bare SHOW GRANTS.
using_roles: ThinVec<AccountName>The USING <role> [, …] active-role restriction; empty when no USING was
written (which the grammar permits only when user is set).
CreateUser
SHOW CREATE USER <user> — the CREATE USER statement that would recreate an account
(MySQL; gated by show_admin).
A sibling of Create held apart because its operand is the shared
AccountName user specification ('u'@'host' or CURRENT_USER [()]), not an
ObjectName — the exact reason the SHOW-family landing deferred it to the user-spec
grammar (see ShowCreateKind, where USER is absent).
Fields
user: AccountNameThe account to recreate (the shared user grammar).
Profile
SHOW PROFILE [<type> [, …]] [FOR QUERY <n>] [LIMIT …] — the per-statement resource
profile (MySQL; gated by show_admin).
The optional types list selects which resource columns to
report (MySQL’s profile_defs; empty when none written — the server defaults to a
standard set). FOR QUERY <n> (query) profiles a specific
entry from SHOW PROFILES rather than the last statement, and the shared
ShowLimit tail narrows the row set. The three clauses are order-fixed:
SHOW PROFILE ALL FOR QUERY 1 parses but SHOW PROFILE FOR QUERY 1 ALL and
SHOW PROFILE LIMIT 5 FOR QUERY 1 are both ER_PARSE_ERROR on mysql:8.4.10.
Distinct from the bare ShowBare::Profiles catalogue listing (SHOW PROFILES).
Fields
types: ThinVec<ShowProfileType>The profile_defs resource-type list, in source order; empty when none written.
LogEvents
SHOW {BINLOG | RELAYLOG} EVENTS [IN '<log>'] [FROM <pos>] [LIMIT …] [FOR CHANNEL '<channel>'] — the binary- / relay-log event dump (MySQL; gated by
show_admin).
The two spellings share one payload — an optional IN '<log>' log-file name, an
optional FROM <pos> start position, and the shared ShowLimit tail — so they ride
this one variant with the spelling as DATA on relay, the
SHOW family’s fold-near-identical-sub-commands precedent. The sole grammar difference
is the trailing FOR CHANNEL '<channel>': it is RELAYLOG-only, so
channel is Some only when relay
is true (SHOW BINLOG EVENTS FOR CHANNEL … is ER_PARSE_ERROR on mysql:8.4.10). The
clause order is fixed: SHOW BINLOG EVENTS FROM 4 IN '<log>' is ER_PARSE_ERROR (the
IN must precede the FROM).
Index
SHOW [EXTENDED] {INDEX | INDEXES | KEYS} {FROM | IN} <tbl> [{FROM | IN} <db>] [WHERE <expr>] — the index-listing statement (MySQL; gated by
show_admin).
Structurally the {FROM | IN}-qualified sibling of Columns: a
mandatory table qualifier, an optional database qualifier, and a filter — but the
filter here is WHERE-only (the MySQL grammar admits no LIKE on SHOW INDEX), so
the parser only ever builds a ShowFilter::Where. KEYS/INDEX/INDEXES are
exact synonyms whose written spelling rides the ShowIndexSpelling tag.
Fields
spelling: ShowIndexSpellingWhich keyword named the listing: INDEX, INDEXES, or KEYS.
filter: Option<ShowFilter<X>>The optional trailing WHERE <expr> narrowing (never LIKE).
Engine
SHOW ENGINE {<name> | ALL} {STATUS | MUTEX | LOGS} — a storage-engine diagnostic
dump (MySQL; gated by show_admin).
The engine operand (engine) is a named engine, or None
for the ALL wildcard; the requested artefact (artifact)
is one of the three fixed report keywords. Distinct from the bare
ShowBare::Engines catalogue listing, which takes no operand.
Fields
artifact: ShowEngineArtifactWhich per-engine report was requested; see ShowEngineArtifact.
ReplicaStatus
SHOW REPLICA STATUS [FOR CHANNEL '<channel>'] — the replication-applier status
(MySQL; gated by show_admin).
The optional channel names a replication channel
(FOR CHANNEL '<name>'). MySQL 8.4 removed the deprecated SHOW SLAVE STATUS
terminology, so there is no spelling axis here.
Fields
Diagnostics
SHOW {WARNINGS | ERRORS} [LIMIT [<offset>,] <row_count>] and SHOW COUNT(*) {WARNINGS | ERRORS} — the diagnostics-area readouts (MySQL; gated by
show_admin).
The WARNINGS vs ERRORS choice rides kind.
count records the COUNT(*) cardinality form, which is
mutually exclusive with a limit in the grammar — the
parser never sets both.
Fields
kind: ShowDiagnosticKindWhich diagnostics list was named: WARNINGS or ERRORS.
RoutineCode
SHOW {PROCEDURE | FUNCTION} CODE <name> — the compiled stored-routine instruction
dump (MySQL debug builds; gated by
show_admin).
Shares the ShowRoutineKind object-keyword axis with
RoutineStatus; the operand is the (schema-qualifiable)
routine name.
Fields
kind: ShowRoutineKindWhich stored-routine kind was named: FUNCTION or PROCEDURE.
name: ObjectNameThe (optionally schema-qualified) routine name.
Trait Implementations§
Source§impl<X: Clone + Extension> Clone for ShowTarget<X>
impl<X: Clone + Extension> Clone for ShowTarget<X>
Source§fn clone(&self) -> ShowTarget<X>
fn clone(&self) -> ShowTarget<X>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl<'de, X> Deserialize<'de> for ShowTarget<X>where
X: Deserialize<'de> + Extension,
impl<'de, X> Deserialize<'de> for ShowTarget<X>where
X: Deserialize<'de> + Extension,
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl<X: Eq + Extension> Eq for ShowTarget<X>
Source§impl<X: Extension + Render> Render for ShowTarget<X>
impl<X: Extension + Render> Render for ShowTarget<X>
Source§fn render(&self, ctx: &RenderCtx<'_>, f: &mut Formatter<'_>) -> Result
fn render(&self, ctx: &RenderCtx<'_>, f: &mut Formatter<'_>) -> Result
Source§fn operand_binding_power(&self) -> Option<BindingPower>
fn operand_binding_power(&self) -> Option<BindingPower>
None (the default) for a self-delimiting node — an atom, call, or
constructor — that never needs parentheses. Read moreSource§impl<X> Serialize for ShowTarget<X>
impl<X> Serialize for ShowTarget<X>
Source§impl<X: Extension> Spanned for ShowTarget<X>
impl<X: Extension> Spanned for ShowTarget<X>
impl<X: PartialEq + Extension> StructuralPartialEq for ShowTarget<X>
Auto Trait Implementations§
impl<X> Freeze for ShowTarget<X>where
X: Freeze,
impl<X> RefUnwindSafe for ShowTarget<X>where
X: RefUnwindSafe,
impl<X> Send for ShowTarget<X>where
X: Send,
impl<X> Sync for ShowTarget<X>where
X: Sync,
impl<X> Unpin for ShowTarget<X>where
X: Unpin,
impl<X> UnsafeUnpin for ShowTarget<X>where
X: UnsafeUnpin,
impl<X> UnwindSafe for ShowTarget<X>where
X: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> DynAstExt for T
impl<T> DynAstExt for T
Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&dyn Any for downcasting a node back to its concrete type.Source§fn dyn_clone(&self) -> Box<dyn DynAstExt>
fn dyn_clone(&self) -> Box<dyn DynAstExt>
Clone (whose
Self-returning signature cannot go through a vtable).Source§fn dyn_eq(&self, other: &dyn DynAstExt) -> bool
fn dyn_eq(&self, other: &dyn DynAstExt) -> bool
PartialEq (whose &Self argument cannot go through a vtable). Equal
iff other holds the same concrete type and that type deems the values
equal; differently-typed nodes are never equal.