pub enum RedoOp {
Show 23 variants
CreateNode {
id: NodeId,
labels: Arc<Vec<String>>,
properties: Arc<PropertyMap>,
},
CreateRel {
id: RelId,
start: NodeId,
end: NodeId,
rel_type: String,
properties: Arc<PropertyMap>,
},
DeleteNode {
id: NodeId,
},
DeleteRel {
id: RelId,
},
SetNodeProp {
id: NodeId,
key: String,
value: Value,
},
RemoveNodeProp {
id: NodeId,
key: String,
},
SetRelProp {
id: RelId,
key: String,
value: Value,
},
RemoveRelProp {
id: RelId,
key: String,
},
AddLabels {
id: NodeId,
labels: Vec<String>,
},
RemoveLabels {
id: NodeId,
labels: Vec<String>,
},
CreateIndex {
name: String,
label: String,
property: String,
},
DropIndex {
name: String,
},
CreateConstraint {
name: String,
relationship: bool,
label: String,
properties: Vec<String>,
kind: String,
property_type: Option<String>,
enforced_label: Option<String>,
},
DropConstraint {
name: String,
},
CatalogIndexDetail {
name: String,
detail: IndexDetailSpec,
options: Value,
},
CatalogDerivedConstraint {
constraint: Constraint,
},
PutDatabase {
name: String,
language: u32,
composite: bool,
},
DropDatabase {
name: String,
},
PutGraphType {
name: String,
body: GraphTypeSpec,
},
SetCurrentGraphType {
body: GraphTypeSpec,
},
PullIdentityPut {
source: String,
kind: PullKind,
remote_id: String,
local_id: i64,
},
OntologySet {
database: String,
spec: String,
},
OntologyDrop {
database: String,
},
}Variants§
CreateNode
CreateRel
DeleteNode
DeleteRel
SetNodeProp
RemoveNodeProp
SetRelProp
RemoveRelProp
AddLabels
RemoveLabels
CreateIndex
DropIndex
CreateConstraint
Fields
DropConstraint
CatalogIndexDetail
Fields
detail: IndexDetailSpecoptions: ValueThe evaluated OPTIONS map (tagged JSON values, see
props_json). Decoded strictly by props_from_json.
CatalogDerivedConstraint
SHOW metadata for an explicitly enforced constraint.
Fields
constraint: ConstraintPutDatabase
DropDatabase
Legacy, decode-only: DROP DATABASE was executable before the
parser failed closed on unsupported administration commands
(ADR-0116), so WALs and snapshots written by those versions may
carry this op. New code never constructs it; replay is the
ADR-0116 §8 no-op (only fixed namespaces exist, and a fixed
namespace can never be dropped). Removing the variant would make
serde reject the old record and hard-fail store open (ADR-0114).
PutGraphType
SetCurrentGraphType
Fields
body: GraphTypeSpecPullIdentityPut
Source-scoped pull identity (ADR-0080). Not a graph CDC event.
OntologySet
Store-level ontology document ops (ADR-0120 §3). Not graph ops:
they carry the validated ontology document verbatim (at most one
per store, for neo4j) and mutate no graph or catalog state; the
derived system_ontologies graph is rebuilt from the document.
The document is bounded by MAX_ONTOLOGY_SPEC_BYTES, checked
before the commit is written.
OntologyDrop
Implementations§
Source§impl RedoOp
impl RedoOp
Sourcepub fn create_constraint(def: ConstraintDef) -> Self
pub fn create_constraint(def: ConstraintDef) -> Self
The RedoOp::CreateConstraint row for one catalog definition — the
one crossing from the catalog shape to the durable op shape, so the
field copies live once (RedoOp::constraint_def is its reader).
Sourcepub fn constraint_def(&self) -> Option<ConstraintDef>
pub fn constraint_def(&self) -> Option<ConstraintDef>
The catalog definition a CreateConstraint row carries, None for
every other op — the reader twin of RedoOp::create_constraint.
pub fn create_node( id: NodeId, labels: impl Into<Arc<Vec<String>>>, properties: impl Into<PropertyMap>, ) -> Self
pub fn create_rel( id: RelId, start: NodeId, end: NodeId, rel_type: String, properties: impl Into<PropertyMap>, ) -> Self
pub fn delete_node(id: NodeId) -> Self
pub fn delete_rel(id: RelId) -> Self
pub fn add_labels(id: NodeId, labels: Vec<String>) -> Self
pub fn remove_labels(id: NodeId, labels: Vec<String>) -> Self
pub fn set_node_prop(id: NodeId, key: String, value: Value) -> Self
pub fn remove_node_prop(id: NodeId, key: String) -> Self
pub fn set_rel_prop(id: RelId, key: String, value: Value) -> Self
pub fn remove_rel_prop(id: RelId, key: String) -> Self
Sourcepub fn ontology_op(&self) -> Option<OntologyOp<'_>>
pub fn ontology_op(&self) -> Option<OntologyOp<'_>>
The typed ontology classification of this op (ADR-0120 §3); None
for every non-ontology op. One match — Self::is_ontology_op,
the WAL’s MDBWAL02 segment-magic rule (ADR-0120 §4), the
scanner’s corruption check and the facade’s commit scan all derive
from it.
Sourcepub fn is_ontology_op(&self) -> bool
pub fn is_ontology_op(&self) -> bool
Whether this is a store-level ontology document op (ADR-0120 §3).
The WAL uses it for the MDBWAL02 segment-magic rule (ADR-0120 §4)
and the scanner for the corruption check; the commit-preflight seam
uses it for the document-size gate.
Sourcepub fn validate_ids(&self) -> Result<()>
pub fn validate_ids(&self) -> Result<()>
The one pre-persist validation entry point, run before writing or
applying redo: every persisted local ID is in range (the upper
bound is reserved because installation advances the ID allocator),
and an OntologySet document is within the 16 MiB ADR-0086 object
envelope (ADR-0120 §3). Non-ontology ops always pass the size arm.
Sourcepub fn is_catalog(&self) -> bool
pub fn is_catalog(&self) -> bool
Whether this is a catalog op: anything but the ten entity ops,
PullIdentityPut and the store-level ontology ops (ADR-0120 §3).
The write overlay replays only these when it resolves its
speculative schema (ADR-0172 §8). Classified once, by
Self::write_target (ADR-0173).
Sourcepub fn write_target(&self) -> WriteTarget<'_>
pub fn write_target(&self) -> WriteTarget<'_>
What this op writes, for ADR-0015 conflict classification. Total:
every variant classifies, so a future op is a compile error here,
not a silently missed conflict rule; consumers bind every payload
from the one classification. Crate-internal: the consumer set is
graph::conflict; re-export if a cross-crate consumer appears.
Sourcepub fn catalog_names(&self) -> Vec<CatalogName<'_>>
pub fn catalog_names(&self) -> Vec<CatalogName<'_>>
Every catalog name this op mentions — a label, a relationship type or a property key — for the write overlay’s catalog facts (ADR-0363 decision 5): the redo log is the scratch’s one write record, so a name a transaction has mentioned is known before the commit publishes it.
Total over the enum: every variant classifies, and a new variant is a
compile error here, never a silently skipped name. Monotone, like the
committed catalog: an op that removes a name still mentions it — a
RemoveLabels reads exactly like an AddLabels, a property REMOVE
like a SET — because a name outlives its last write. A drop names
only its schema object (an index or constraint name), never the label
or key it was built on, so it cannot un-name one either.
The names are the graph catalog’s. Two DDL families name them without
writing data: an index or constraint create names its subject label
(or relationship type) and its property keys, and the typed index
detail names every indexed property plus a vector index’s WITH
keys. CreateIndex.property carries the legacy {props}#{KIND}#{name}
encoding on the constraint-backed rows (and a bare name on the IR
path), so its head is the key
(split_legacy_property_encoding). Store metadata — index,
constraint, database, graph-type and ontology names — is not a graph
catalog name and contributes nothing.