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

Function make_cdc_event

nodedb-test-support/src/lib.rs:25–42  ·  view source on GitHub ↗
(seq: u64, partition: u32, collection: &str, op: &str)

Source from the content-addressed store, hash-verified

23/// Create a [`CdcEvent`] with sensible test defaults.
24#[allow(dead_code)]
25pub fn make_cdc_event(seq: u64, partition: u32, collection: &str, op: &str) -> CdcEvent {
26 CdcEvent {
27 sequence: seq,
28 partition,
29 collection: collection.into(),
30 op: op.into(),
31 row_id: format!("r-{seq}"),
32 event_time: now_ms(),
33 lsn: seq * 10,
34 tenant_id: 1,
35 new_value: Some(serde_json::json!({"id": seq})),
36 old_value: None,
37 schema_version: 0,
38 field_diffs: None,
39 system_time_ms: None,
40 valid_time_ms: None,
41 }
42}

Calls 1

now_msFunction · 0.70