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

Function versioned_int_default_zero_not_null

nodedb-strict/src/decode.rs:849–863  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

847
848 #[test]
849 fn versioned_int_default_zero_not_null() {
850 // Schema gained a NOT NULL column with DEFAULT 0.
851 let mut schema = base_schema();
852 let mut col = ColumnDef::required("score", ColumnType::Int64).with_default("0");
853 col.added_at_version = 2;
854 schema.columns.push(col);
855 schema.version = 2;
856
857 let decoder = TupleDecoder::new(&schema);
858 let tuple = base_tuple();
859
860 // Column 2 (score) did not exist when the tuple was written (old_col_count=2).
861 let val = decoder.extract_value_versioned(&tuple, 2, 2).unwrap();
862 assert_eq!(val, Value::Integer(0), "expected default 0, not null");
863 }
864
865 #[test]
866 fn versioned_text_default_pending_not_null() {

Callers

nothing calls this directly

Calls 6

base_schemaFunction · 0.85
requiredFunction · 0.85
base_tupleFunction · 0.85
with_defaultMethod · 0.80
pushMethod · 0.45

Tested by

no test coverage detected