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

Method doc_create_cluster

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

Source from the content-addressed store, hash-verified

433 }
434
435 pub(crate) fn doc_create_cluster<'a, T: AstInfo>(
436 &'a self,
437 v: &'a CreateClusterStatement<T>,
438 ) -> RcDoc<'a> {
439 let mut docs = Vec::new();
440
441 // CREATE CLUSTER name
442 docs.push(nest_title("CREATE CLUSTER", self.doc_display_pass(&v.name)));
443
444 // OPTIONS (...)
445 if !v.options.is_empty() {
446 docs.push(bracket(
447 "(",
448 comma_separate(|o| self.doc_display_pass(o), &v.options),
449 ")",
450 ));
451 }
452
453 // FEATURES (...)
454 if !v.features.is_empty() {
455 docs.push(bracket(
456 "FEATURES (",
457 comma_separate(|f| self.doc_display_pass(f), &v.features),
458 ")",
459 ));
460 }
461
462 RcDoc::intersperse(docs, Doc::line()).group()
463 }
464
465 pub(crate) fn doc_create_cluster_replica<'a, T: AstInfo>(
466 &'a self,

Callers 1

to_docMethod · 0.80

Calls 7

nest_titleFunction · 0.85
bracketFunction · 0.85
comma_separateFunction · 0.85
doc_display_passMethod · 0.80
groupMethod · 0.80
pushMethod · 0.45
is_emptyMethod · 0.45

Tested by

no test coverage detected