sim_kernel/catalog/journal.rs
1use crate::Symbol;
2
3/// One append-only audit entry recording a committed catalog operation.
4#[derive(Clone, Debug, PartialEq, Eq)]
5pub struct CatalogEvent {
6 /// Catalog epoch at which the operation committed.
7 pub epoch: u64,
8 /// The committed operation.
9 pub op: CatalogEventOp,
10}
11
12/// The committed operation recorded by a [`CatalogEvent`].
13#[derive(Clone, Debug, PartialEq, Eq)]
14pub enum CatalogEventOp {
15 /// A row was inserted or replaced.
16 PutRow {
17 /// Table holding the row.
18 table: Symbol,
19 /// Key of the affected row.
20 key: Symbol,
21 },
22 /// A row was deleted.
23 DeleteRow {
24 /// Table that held the row.
25 table: Symbol,
26 /// Key of the deleted row.
27 key: Symbol,
28 },
29 /// A sequence advanced to a new value.
30 Sequence {
31 /// Sequence that advanced.
32 name: Symbol,
33 /// Next value of the sequence after the bump.
34 next: u64,
35 },
36}