MCPcopy Create free account
hub / github.com/NodeDB-Lab/nodedb / delete_by_pk

Function delete_by_pk

nodedb-columnar/src/mutation/tests.rs:46–66  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

44
45#[test]
46fn delete_by_pk() {
47 let mut engine = MutationEngine::new("test".into(), test_schema());
48
49 engine
50 .insert(&[
51 Value::Integer(1),
52 Value::String("Alice".into()),
53 Value::Null,
54 ])
55 .expect("insert");
56
57 let result = engine.delete(&Value::Integer(1)).expect("delete");
58 assert_eq!(result.wal_records.len(), 1);
59 assert!(matches!(
60 &result.wal_records[0],
61 ColumnarWalRecord::DeleteRows { .. }
62 ));
63
64 // PK should be removed from index.
65 assert!(engine.pk_index().is_empty());
66}
67
68#[test]
69fn delete_nonexistent_pk() {

Callers

nothing calls this directly

Calls 4

test_schemaFunction · 0.70
expectMethod · 0.45
insertMethod · 0.45
deleteMethod · 0.45

Tested by

no test coverage detected