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

Function test_insert

crates/core/src/sql/execute.rs:1323–1339  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1321
1322 #[test]
1323 fn test_insert() -> ResultTest<()> {
1324 let (db, mut input) = create_data(1)?;
1325
1326 let result = run_for_testing(&db, "INSERT INTO inventory (inventory_id, name) VALUES (2, 'test')")?;
1327
1328 assert_eq!(result.len(), 0, "Return results");
1329
1330 let mut result = run_for_testing(&db, "SELECT * FROM inventory")?;
1331
1332 input.data.push(product![2u64, "test"]);
1333 input.data.sort();
1334 result.sort();
1335
1336 assert_eq!(result, input.data, "Inventory");
1337
1338 Ok(())
1339 }
1340
1341 #[test]
1342 fn test_delete() -> ResultTest<()> {

Callers

nothing calls this directly

Calls 4

create_dataFunction · 0.85
run_for_testingFunction · 0.85
OkFunction · 0.50
pushMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…