MCPcopy Create free account
hub / github.com/MaterializeInc/materialize / starts_with_show

Method starts_with_show

src/sql-parser/src/ast/defs/query.rs:140–146  ·  view source on GitHub ↗

Whether the rendered SQL for this body begins with `SHOW` (i.e. its leftmost leaf is a `Show`). Such a body must be parenthesized when it is a statement's query, because a top-level leading `SHOW` is dispatched as a `Statement::Show` and would swallow any following set operator.

(&self)

Source from the content-addressed store, hash-verified

138 /// a statement's query, because a top-level leading `SHOW` is dispatched as
139 /// a `Statement::Show` and would swallow any following set operator.
140 pub fn starts_with_show(&self) -> bool {
141 match self {
142 SetExpr::Show(_) => true,
143 SetExpr::SetOperation { left, .. } => left.starts_with_show(),
144 _ => false,
145 }
146 }
147}
148
149impl<T: AstInfo> AstDisplay for SetExpr<T> {

Callers 2

doc_select_statementMethod · 0.80
fmtMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected