MCPcopy Create free account
hub / github.com/clockworklabs/SpacetimeDB / build_view_def

Function build_view_def

crates/expr/src/statement.rs:611–622  ·  view source on GitHub ↗
(
            builder: &mut RawModuleDefV9Builder,
            name: &str,
            columns: impl Into<ProductType>,
            is_anonymous: bool,
        )

Source from the content-addressed store, hash-verified

609 }
610
611 fn build_view_def(
612 builder: &mut RawModuleDefV9Builder,
613 name: &str,
614 columns: impl Into<ProductType>,
615 is_anonymous: bool,
616 ) {
617 let name = RawIdentifier::new(name);
618 let product_type = AlgebraicType::from(columns.into());
619 let type_ref = builder.add_algebraic_type([], name.clone(), product_type, true);
620 let return_type = AlgebraicType::array(AlgebraicType::Ref(type_ref));
621 builder.add_view(name, 0, true, is_anonymous, ProductType::unit(), return_type);
622 }
623
624 let mut builder = RawModuleDefV9Builder::new();
625 build_view_def(&mut builder, "v", [("a", AlgebraicType::String)], true);

Callers 1

viewsFunction · 0.85

Calls 6

newFunction · 0.50
arrayFunction · 0.50
unitFunction · 0.50
add_algebraic_typeMethod · 0.45
cloneMethod · 0.45
add_viewMethod · 0.45

Tested by 1

viewsFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…