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

Method insert_bulk

crates/bench/src/spacetime_module.rs:148–158  ·  view source on GitHub ↗
(&mut self, table_id: &Self::TableId, rows: Vec<T>)

Source from the content-addressed store, hash-verified

146 }
147
148 fn insert_bulk<T: BenchTable>(&mut self, table_id: &Self::TableId, rows: Vec<T>) -> ResultBench<()> {
149 let rows = rows.into_iter().map(|row| row.into_product_value()).collect();
150 let args = product![ArrayValue::Product(rows)];
151 let SpacetimeModule { runtime, module, .. } = self;
152 let reducer_name = format!("insert_bulk_{}", table_id.snake_case);
153
154 runtime.block_on(async move {
155 module.call_reducer_binary(&reducer_name, &args).await?;
156 Ok(())
157 })
158 }
159
160 fn update_bulk<T: BenchTable>(&mut self, table_id: &Self::TableId, row_count: u32) -> ResultBench<()> {
161 let args = product![row_count];

Callers

nothing calls this directly

Calls 7

into_product_valueMethod · 0.80
call_reducer_binaryMethod · 0.80
OkFunction · 0.50
collectMethod · 0.45
mapMethod · 0.45
into_iterMethod · 0.45
block_onMethod · 0.45

Tested by

no test coverage detected