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

Method doc_set_expr

src/sql-pretty/src/doc.rs:1029–1057  ·  view source on GitHub ↗
(&'a self, v: &'a SetExpr<T>)

Source from the content-addressed store, hash-verified

1027 }
1028
1029 fn doc_set_expr<'a, T: AstInfo>(&'a self, v: &'a SetExpr<T>) -> RcDoc<'a> {
1030 match v {
1031 SetExpr::Select(v) => self.doc_select(v),
1032 SetExpr::Query(v) => bracket("(", self.doc_query(v), ")"),
1033 SetExpr::SetOperation {
1034 op,
1035 all,
1036 left,
1037 right,
1038 } => {
1039 let all_str = if *all { " ALL" } else { "" };
1040 RcDoc::concat([
1041 self.doc_set_expr(left),
1042 RcDoc::line(),
1043 RcDoc::concat([
1044 RcDoc::text(format!("{}{}", op, all_str)),
1045 RcDoc::line(),
1046 self.doc_set_expr(right),
1047 ])
1048 .nest(TAB)
1049 .group(),
1050 ])
1051 }
1052 SetExpr::Values(v) => self.doc_values(v),
1053 SetExpr::Show(v) => self.doc_display(v, "SHOW"),
1054 SetExpr::Table(v) => nest(RcDoc::text("TABLE"), self.doc_display_pass(v)),
1055 }
1056 .group()
1057 }
1058
1059 fn doc_values<'a, T: AstInfo>(&'a self, v: &'a Values<T>) -> RcDoc<'a> {
1060 let rows =

Callers 1

doc_queryMethod · 0.80

Calls 9

bracketFunction · 0.85
concatFunction · 0.85
nestFunction · 0.85
groupMethod · 0.80
doc_selectMethod · 0.80
doc_queryMethod · 0.80
doc_valuesMethod · 0.80
doc_displayMethod · 0.80
doc_display_passMethod · 0.80

Tested by

no test coverage detected