Struct kanidmd_lib::be::BackendWriteTransaction
source · pub struct BackendWriteTransaction<'a> { /* private fields */ }
Implementations§
source§impl<'a> BackendWriteTransaction<'a>
impl<'a> BackendWriteTransaction<'a>
pub fn create(
&mut self,
cid: &Cid,
entries: Vec<Entry<EntrySealed, EntryNew>>
) -> Result<Vec<Entry<EntrySealed, EntryCommitted>>, OperationError>
sourcepub fn refresh(
&mut self,
entries: Vec<Entry<EntrySealed, EntryNew>>
) -> Result<Vec<Entry<EntrySealed, EntryCommitted>>, OperationError>
pub fn refresh(
&mut self,
entries: Vec<Entry<EntrySealed, EntryNew>>
) -> Result<Vec<Entry<EntrySealed, EntryCommitted>>, OperationError>
This is similar to create, but used in the replication path as it skips the modification of the RUV and the checking of CIDs since these actions are not required during a replication refresh (else we’d create an infinite replication loop.)
pub fn modify(
&mut self,
cid: &Cid,
pre_entries: &[Arc<EntrySealedCommitted>],
post_entries: &[EntrySealedCommitted]
) -> Result<(), OperationError>
pub fn reap_tombstones(&mut self, cid: &Cid) -> Result<usize, OperationError>
pub fn update_idxmeta(
&mut self,
idxkeys: Vec<IdxKey>
) -> Result<(), OperationError>
pub fn upgrade_reindex(&mut self, v: i64) -> Result<(), OperationError>
pub fn reindex(&mut self) -> Result<(), OperationError>
pub fn restore(&mut self, src_path: &str) -> Result<(), OperationError>
pub fn ruv_rebuild(&mut self) -> Result<(), OperationError>
pub fn commit(self) -> Result<(), OperationError>
pub fn get_db_s_uuid(&mut self) -> Uuid
sourcepub fn set_db_d_uuid(&mut self, nsid: Uuid) -> Result<(), OperationError>
pub fn set_db_d_uuid(&mut self, nsid: Uuid) -> Result<(), OperationError>
Manually set a new domain UUID and store it into the DB. This is used as part of a replication refresh.
sourcepub fn get_db_d_uuid(&mut self) -> Uuid
pub fn get_db_d_uuid(&mut self) -> Uuid
This pulls the domain UUID from the database
pub fn set_db_ts_max(&mut self, ts: Duration) -> Result<(), OperationError>
pub fn get_db_ts_max(&mut self, ts: Duration) -> Result<Duration, OperationError>
Trait Implementations§
source§impl<'a> BackendTransaction for BackendWriteTransaction<'a>
impl<'a> BackendTransaction for BackendWriteTransaction<'a>
type IdlLayerType = IdlArcSqliteWriteTransaction<'a>
type RuvType = ReplicationUpdateVectorWriteTransaction<'a>
fn get_idlayer(&mut self) -> &mut IdlArcSqliteWriteTransaction<'a>
fn get_ruv(&mut self) -> &mut ReplicationUpdateVectorWriteTransaction<'a>
fn get_idxmeta_ref(&self) -> &IdxMeta
source§fn filter2idl(
&mut self,
filt: &FilterResolved,
thres: usize
) -> Result<(IdList, FilterPlan), OperationError>
fn filter2idl(
&mut self,
filt: &FilterResolved,
thres: usize
) -> Result<(IdList, FilterPlan), OperationError>
Recursively apply a filter, transforming into IdList’s on the way. This builds a query
execution log, so that it can be examined how an operation proceeded. Read more
fn search(
&mut self,
erl: &Limits,
filt: &Filter<FilterValidResolved>
) -> Result<Vec<Arc<EntrySealedCommitted>>, OperationError>
source§fn exists(
&mut self,
erl: &Limits,
filt: &Filter<FilterValidResolved>
) -> Result<bool, OperationError>
fn exists(
&mut self,
erl: &Limits,
filt: &Filter<FilterValidResolved>
) -> Result<bool, OperationError>
Given a filter, assert some condition exists.
Basically, this is a specialised case of search, where we don’t need to
load any candidates if they match. This is heavily used in uuid
refint and attr uniqueness. Read more