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

Function create_data

crates/core/src/sql/execute.rs:354–366  ·  view source on GitHub ↗
(total_rows: u64)

Source from the content-addressed store, hash-verified

352 }
353
354 fn create_data(total_rows: u64) -> ResultTest<(TestDB, TestRows)> {
355 let stdb = TestDB::durable()?;
356
357 let rows: Vec<_> = (1..=total_rows)
358 .map(|i| product!(i, format!("health{i}").into_boxed_str()))
359 .collect();
360 let head = ProductType::from([("inventory_id", AlgebraicType::U64), ("name", AlgebraicType::String)]);
361
362 with_auto_commit(&stdb, |tx| {
363 create_table_with_rows(&stdb, tx, "inventory", head.clone(), &rows, StAccess::Public)
364 })?;
365 Ok((stdb, TestRows { data: rows }))
366 }
367
368 fn create_identity_table(table_name: &str) -> ResultTest<(TestDB, TestRows)> {
369 let stdb = TestDB::durable()?;

Callers 13

test_select_starFunction · 0.85
test_limitFunction · 0.85
test_countFunction · 0.85
test_select_star_tableFunction · 0.85
test_select_catalogFunction · 0.85
test_select_columnFunction · 0.85
test_whereFunction · 0.85
test_orFunction · 0.85
test_nestedFunction · 0.85
test_insertFunction · 0.85
test_deleteFunction · 0.85
test_updateFunction · 0.85

Calls 6

with_auto_commitFunction · 0.85
create_table_with_rowsFunction · 0.85
OkFunction · 0.50
collectMethod · 0.45
mapMethod · 0.45
cloneMethod · 0.45

Tested by 13

test_select_starFunction · 0.68
test_limitFunction · 0.68
test_countFunction · 0.68
test_select_star_tableFunction · 0.68
test_select_catalogFunction · 0.68
test_select_columnFunction · 0.68
test_whereFunction · 0.68
test_orFunction · 0.68
test_nestedFunction · 0.68
test_insertFunction · 0.68
test_deleteFunction · 0.68
test_updateFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…