#[non_exhaustive]pub enum WriteOp {
CreateNode {
labels: Vec<SmolStr>,
props: Expr,
bind: Option<VarId>,
},
CreateRel {
from: VarId,
to: VarId,
rel_type: SmolStr,
props: Expr,
bind: Option<VarId>,
},
MergeNode {
labels: Vec<SmolStr>,
props: Expr,
on_create: Vec<WriteOp>,
on_match: Vec<WriteOp>,
bind: Option<VarId>,
},
MergeRel {
from: VarId,
to: VarId,
rel_type: SmolStr,
props: Expr,
on_create: Vec<WriteOp>,
on_match: Vec<WriteOp>,
bind: Option<VarId>,
},
SetProperty {
target: VarId,
prop: SmolStr,
value: Expr,
},
SetLabels {
target: VarId,
labels: Vec<SmolStr>,
},
RemoveProperty {
target: VarId,
prop: SmolStr,
},
RemoveLabels {
target: VarId,
labels: Vec<SmolStr>,
},
Delete {
targets: Vec<Expr>,
detach: bool,
},
}Expand description
Logical write-plan operator. Spec §12.1.
Write operators are applied sequentially after the read phase produces a row. Consumers own the sequencing and transactional semantics. This crate describes what to write, not how.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
CreateNode
Create a new node with the given labels and properties.
props is evaluated to a map expression at write time. bind, if
present, makes the new node available under that variable for
subsequent operators. Spec §12.1 W1.
Fields
CreateRel
Create a new relationship between two already-bound nodes.
Spec §12.1 W2.
Fields
MergeNode
Merge a node — create if absent, match if present.
on_create / on_match are applied depending on whether the node
was newly created or already existed. Spec §12.1 W3.
Fields
MergeRel
Merge a relationship — create if absent, match if present.
Analogous to WriteOp::MergeNode but for relationships.
Spec §12.1 W4.
Fields
SetProperty
Set a single property on a node or relationship. Spec §12.1 W5.
Fields
SetLabels
Add or replace the label set on a node. Spec §12.1 W6.
RemoveProperty
Remove a single property from a node or relationship. Spec §12.1 W7.
RemoveLabels
Remove labels from a node. Spec §12.1 W8.
Delete
Delete nodes or relationships. Spec §12.1 W9.
When detach is true this is DETACH DELETE, which removes all
incident relationships before deleting the node.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for WriteOp
impl<'de> Deserialize<'de> for WriteOp
Source§fn deserialize<D: Deserializer<'de>>(d: D) -> Result<Self, D::Error>
fn deserialize<D: Deserializer<'de>>(d: D) -> Result<Self, D::Error>
impl Eq for WriteOp
impl StructuralPartialEq for WriteOp
Auto Trait Implementations§
impl Freeze for WriteOp
impl RefUnwindSafe for WriteOp
impl Send for WriteOp
impl Sync for WriteOp
impl Unpin for WriteOp
impl UnsafeUnpin for WriteOp
impl UnwindSafe for WriteOp
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.