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

Function encode_timestamp

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

Source from the content-addressed store, hash-verified

461
462 #[test]
463 fn encode_timestamp() {
464 let schema =
465 StrictSchema::new(vec![ColumnDef::required("ts", ColumnType::Timestamp)]).unwrap();
466 let encoder = TupleEncoder::new(&schema);
467
468 let dt = NdbDateTime::from_micros(1_700_000_000_000_000);
469 let tuple = encoder.encode(&[Value::NaiveDateTime(dt)]).unwrap();
470 let micros = i64::from_le_bytes(tuple[10..18].try_into().unwrap());
471 assert_eq!(micros, 1_700_000_000_000_000);
472 }
473
474 #[test]
475 fn encode_timestamptz() {

Callers

nothing calls this directly

Calls 1

encodeMethod · 0.45

Tested by

no test coverage detected