use nodedb_types::RlsWriteCheck;
use crate::physical_plan::document::UpdateValue;
#[derive(
Debug,
Clone,
PartialEq,
Default,
serde::Serialize,
serde::Deserialize,
zerompk::ToMessagePack,
zerompk::FromMessagePack,
)]
pub enum KvBatchIntent {
#[default]
Put,
Upsert,
Insert,
InsertIfAbsent,
Merge {
updates: Vec<(String, UpdateValue)>,
rls_write_check: RlsWriteCheck,
},
}
impl KvBatchIntent {
pub fn depends_on_stored_rows(&self) -> bool {
match self {
KvBatchIntent::InsertIfAbsent | KvBatchIntent::Merge { .. } => true,
KvBatchIntent::Put | KvBatchIntent::Upsert | KvBatchIntent::Insert => false,
}
}
}