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

Function table

crates/engine/src/relational_db.rs:2351–2362  ·  view source on GitHub ↗
(
        name: &str,
        columns: ProductType,
        f: impl FnOnce(RawTableDefBuilder<'_>) -> RawTableDefBuilder,
    )

Source from the content-addressed store, hash-verified

2349 }
2350
2351 fn table(
2352 name: &str,
2353 columns: ProductType,
2354 f: impl FnOnce(RawTableDefBuilder<'_>) -> RawTableDefBuilder,
2355 ) -> TableSchema {
2356 let mut builder = RawModuleDefV9Builder::new();
2357 f(builder.build_table_with_new_type(RawIdentifier::new(name), columns, true));
2358 let raw = builder.finish();
2359 let def: ModuleDef = raw.try_into().expect("table validation failed");
2360 let table = def.table(name).expect("table not found");
2361 TableSchema::from_module_def(&def, table, (), TableId::SENTINEL)
2362 }
2363
2364 fn view_module_def() -> ModuleDef {
2365 let mut builder = RawModuleDefV9Builder::new();

Callers 14

my_tableFunction · 0.70
table_auto_incFunction · 0.70
table_indexedFunction · 0.70
test_identityFunction · 0.70
test_cascade_drop_tableFunction · 0.70
test_multi_column_indexFunction · 0.70
type_relvarMethod · 0.50
type_insertFunction · 0.50
type_deleteFunction · 0.50
type_updateFunction · 0.50

Calls 5

try_intoMethod · 0.80
newFunction · 0.50
finishMethod · 0.45
tableMethod · 0.45

Tested by 4

test_identityFunction · 0.56
test_cascade_drop_tableFunction · 0.56
test_multi_column_indexFunction · 0.56

Used in the wild real call sites across dependent graphs

searching dependent graphs…