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

Function encode_timestamptz

nodedb-strict/src/encode.rs:475–484  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

473
474 #[test]
475 fn encode_timestamptz() {
476 let schema =
477 StrictSchema::new(vec![ColumnDef::required("ts", ColumnType::Timestamptz)]).unwrap();
478 let encoder = TupleEncoder::new(&schema);
479
480 let dt = NdbDateTime::from_micros(1_700_000_000_000_000);
481 let tuple = encoder.encode(&[Value::DateTime(dt)]).unwrap();
482 let micros = i64::from_le_bytes(tuple[10..18].try_into().unwrap());
483 assert_eq!(micros, 1_700_000_000_000_000);
484 }
485
486 #[test]
487 fn encode_decode_json_column() {

Callers

nothing calls this directly

Calls 1

encodeMethod · 0.45

Tested by

no test coverage detected