pub enum OnConflict {
Error,
Skip,
Replace,
}Expand description
What a batch node insert does when its key is already taken.
A mirror rebuild writes a frame onto a store that already has content, so “the key exists” is a routine answer rather than a failure. The decision is made during the batch’s existing validate pass, from one id-map lookup per row, so the frame stays atomic and re-ingest stays O(n).
Variants§
Error
Refuse the whole frame with GraphError::DuplicateKey. The default,
and the only behaviour before v0.6.10.
Skip
Leave the stored node exactly as it is — properties, label and edges —
and count it in BatchOutcome::skipped.
Replace
Keep the key and make the node’s properties exactly the supplied
props: supplied fields are set, fields absent from the supplied props
are removed. A supplied label that differs from the stored one, and a
supplied ns that would move the node, are row errors — relabelling is
GraphDb::rename_node, not a side effect of a rebuild.
Two properties are outside “exactly”, both because they are not the caller’s to supply:
nsis immutable, so an omittednsleaves the node where it is rather than moving it todefault;- a property a view owns is kept, not removed. Supplying one is a
row error, so omitting it cannot be a request to delete it, and
refusing the row instead would make
Replaceimpossible for the whole population a view has written to. Each such field kept is counted inBatchOutcome::kept_view_owned— the row is stillreplacedand still raises no row error, so that count is the only signal a caller gets that the stored node carries a field its frame did not describe.
Trait Implementations§
Source§impl Clone for OnConflict
impl Clone for OnConflict
impl Copy for OnConflict
Source§impl Debug for OnConflict
impl Debug for OnConflict
Source§impl Default for OnConflict
impl Default for OnConflict
impl Eq for OnConflict
Source§impl PartialEq for OnConflict
impl PartialEq for OnConflict
impl StructuralPartialEq for OnConflict
Auto Trait Implementations§
impl Freeze for OnConflict
impl RefUnwindSafe for OnConflict
impl Send for OnConflict
impl Sync for OnConflict
impl Unpin for OnConflict
impl UnsafeUnpin for OnConflict
impl UnwindSafe for OnConflict
Blanket Implementations§
Source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
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<T> LayoutRaw for T
impl<T> LayoutRaw for T
Source§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Source§impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
Source§unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
Source§fn resolve_niched(out: Place<NichedOption<T, N1>>)
fn resolve_niched(out: Place<NichedOption<T, N1>>)
out indicating that a T is niched.