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

Function build_index_sql

src/mz-deploy/src/cli/commands/explain.rs:710–724  ·  view source on GitHub ↗

Build SQL for creating an index in the explain schema.

(
    index: &CreateIndexStatement<Raw>,
    on_object: &ObjectId,
    explain_db: &str,
    explain_schema: &str,
)

Source from the content-addressed store, hash-verified

708
709/// Build SQL for creating an index in the explain schema.
710fn build_index_sql(
711 index: &CreateIndexStatement<Raw>,
712 on_object: &ObjectId,
713 explain_db: &str,
714 explain_schema: &str,
715) -> String {
716 let fqn: FullyQualifiedName = on_object.clone().into();
717 let visitor =
718 NormalizingVisitor::explain(&fqn, explain_db.to_string(), explain_schema.to_string());
719
720 let mut indexes = vec![index.clone()];
721 visitor.normalize_index_references(&mut indexes);
722 visitor.normalize_index_clusters(&mut indexes);
723 indexes.into_iter().next().unwrap().to_string()
724}
725
726/// Build SQL for creating a view in the explain schema.
727fn build_view_sql(

Callers 1

execute_explainFunction · 0.85

Calls 8

explainFunction · 0.85
unwrapMethod · 0.80
cloneMethod · 0.45
to_stringMethod · 0.45
nextMethod · 0.45
into_iterMethod · 0.45

Tested by

no test coverage detected