(
&'a self,
v: &'a SelectStatement<T>,
)
| 909 | } |
| 910 | |
| 911 | pub(crate) fn doc_select_statement<'a, T: AstInfo>( |
| 912 | &'a self, |
| 913 | v: &'a SelectStatement<T>, |
| 914 | ) -> RcDoc<'a> { |
| 915 | let query = self.doc_query(&v.query); |
| 916 | // A query whose rendering begins with `SHOW` (a bare `SHOW` body or a |
| 917 | // set operation whose leftmost operand is one) only reparses when |
| 918 | // parenthesized — a top-level leading `SHOW` is dispatched directly and |
| 919 | // terminates the statement. Mirror `AstDisplay for SelectStatement`. |
| 920 | let mut doc = if v.query.body.starts_with_show() { |
| 921 | bracket("(", query, ")") |
| 922 | } else { |
| 923 | query |
| 924 | }; |
| 925 | if let Some(as_of) = &v.as_of { |
| 926 | doc = intersperse_line_nest([doc, self.doc_as_of(as_of)]); |
| 927 | } |
| 928 | doc.group() |
| 929 | } |
| 930 | |
| 931 | fn doc_order_by<'a, T: AstInfo>(&'a self, v: &'a [OrderByExpr<T>]) -> RcDoc<'a> { |
| 932 | title_comma_separate("ORDER BY", |o| self.doc_order_by_expr(o), v) |
no test coverage detected