(&'a self, v: &'a TableFactor<T>)
| 1104 | } |
| 1105 | |
| 1106 | fn doc_table_factor<'a, T: AstInfo>(&'a self, v: &'a TableFactor<T>) -> RcDoc<'a> { |
| 1107 | match v { |
| 1108 | TableFactor::Derived { |
| 1109 | lateral, |
| 1110 | subquery, |
| 1111 | alias, |
| 1112 | } => { |
| 1113 | let prefix = if *lateral { "LATERAL (" } else { "(" }; |
| 1114 | let mut docs = vec![bracket(prefix, self.doc_query(subquery), ")")]; |
| 1115 | if let Some(alias) = alias { |
| 1116 | docs.push(RcDoc::text(format!("AS {}", alias))); |
| 1117 | } |
| 1118 | intersperse_line_nest(docs) |
| 1119 | } |
| 1120 | TableFactor::NestedJoin { join, alias } => { |
| 1121 | let mut doc = bracket("(", self.doc_table_with_joins(join), ")"); |
| 1122 | if let Some(alias) = alias { |
| 1123 | doc = nest(doc, RcDoc::text(format!("AS {}", alias))); |
| 1124 | } |
| 1125 | doc |
| 1126 | } |
| 1127 | TableFactor::Table { name, alias } => { |
| 1128 | let mut doc = self.doc_display_pass(name); |
| 1129 | if let Some(alias) = alias { |
| 1130 | doc = nest(doc, RcDoc::text(format!("AS {}", alias))); |
| 1131 | } |
| 1132 | doc |
| 1133 | } |
| 1134 | _ => self.doc_display(v, "table factor variant"), |
| 1135 | } |
| 1136 | } |
| 1137 | |
| 1138 | fn doc_distinct<'a, T: AstInfo>(&'a self, v: &'a Distinct<T>) -> RcDoc<'a> { |
| 1139 | match v { |
no test coverage detected