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

Function create_table_t

crates/core/src/estimation.rs:174–188  ·  view source on GitHub ↗
(db: &RelationalDB, indexed: bool)

Source from the content-addressed store, hash-verified

172 }
173
174 fn create_table_t(db: &RelationalDB, indexed: bool) {
175 let indexes = &[0.into()];
176 let indexes = if indexed { indexes } else { &[] as &[_] };
177 let table_id = db
178 .create_table_for_test("T", &["a", "b"].map(|n| (n, AlgebraicType::U64)), indexes)
179 .expect("Failed to create table");
180
181 with_auto_commit(db, |tx| -> Result<(), DBError> {
182 for i in 0u64..10u64 {
183 insert(db, tx, table_id, &product![i % 5, i]).expect("failed to insert into table");
184 }
185 Ok(())
186 })
187 .expect("failed to insert into table");
188 }
189
190 #[test]
191 fn cardinality_estimation_index_lookup() {

Calls 5

with_auto_commitFunction · 0.85
create_table_for_testMethod · 0.80
insertFunction · 0.50
OkFunction · 0.50
mapMethod · 0.45

Tested by 2

Used in the wild real call sites across dependent graphs

searching dependent graphs…