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

Function test_rollback

crates/engine/src/relational_db.rs:2956–2971  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

2954
2955 #[test]
2956 fn test_rollback() -> ResultTest<()> {
2957 let stdb = TestDB::durable()?;
2958
2959 let mut tx = begin_mut_tx(&stdb);
2960
2961 let table_id = stdb.create_table(&mut tx, my_table(AlgebraicType::I32))?;
2962 stdb.commit_tx(tx)?;
2963
2964 let mut tx = begin_mut_tx(&stdb);
2965 insert_three_i32s(&stdb, &mut tx, table_id)?;
2966 let _ = stdb.rollback_mut_tx(tx);
2967
2968 let tx = begin_mut_tx(&stdb);
2969 assert_eq!(collect_sorted::<i32>(&stdb, &tx, table_id)?, Vec::<i32>::new());
2970 Ok(())
2971 }
2972
2973 #[test]
2974 fn test_auto_inc() -> ResultTest<()> {

Callers

nothing calls this directly

Calls 7

my_tableFunction · 0.85
insert_three_i32sFunction · 0.85
commit_txMethod · 0.80
begin_mut_txFunction · 0.70
OkFunction · 0.50
create_tableMethod · 0.45
rollback_mut_txMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…