pub struct SQLiteBTreeIndexStore { /* private fields */ }Implementations§
Source§impl SQLiteBTreeIndexStore
impl SQLiteBTreeIndexStore
pub fn visit_entries( &self, table: &str, field: &ValueIndexKey, visit: &mut dyn FnMut(DocId, Value) -> StorageBackendResult<()>, ) -> StorageBackendResult<bool>
Source§impl SQLiteBTreeIndexStore
impl SQLiteBTreeIndexStore
pub fn new(conn: ManagedConnection) -> Self
Sourcepub fn probe_equal(
&self,
table: &str,
field: &ValueIndexKey,
value: &Value,
) -> Result<Option<Vec<DocId>>>
pub fn probe_equal( &self, table: &str, field: &ValueIndexKey, value: &Value, ) -> Result<Option<Vec<DocId>>>
Seek the persisted value index, retaining native snapshot and private-row visibility.
Sourcepub fn visit_equal(
&self,
table: &str,
field: &ValueIndexKey,
value: &Value,
visit: &mut dyn FnMut(DocId) -> bool,
) -> Result<bool>
pub fn visit_equal( &self, table: &str, field: &ValueIndexKey, value: &Value, visit: &mut dyn FnMut(DocId) -> bool, ) -> Result<bool>
Visit ordered equality candidates without retaining their population. Unsupported snapshots or domains decline before invoking the callback.
pub fn fields(&self, table: &str) -> Result<Vec<ValueIndexKey>>
pub fn repairs(&self) -> Result<Vec<(String, ValueIndexKey)>>
pub fn clear_repair(&self, table: &str, field: &ValueIndexKey) -> Result<()>
Sourcepub fn read_entry(
&self,
table: &str,
field: &ValueIndexKey,
doc_id: DocId,
) -> Result<ValueIndexEntry>
pub fn read_entry( &self, table: &str, field: &ValueIndexKey, doc_id: DocId, ) -> Result<ValueIndexEntry>
Read one stored key without rebuilding or reevaluating its expression. Both metadata and entry come from the same retained native or connection read.
Sourcepub fn load(
&self,
table: &str,
field: &ValueIndexKey,
) -> Result<Option<Vec<(DocId, Value)>>>
pub fn load( &self, table: &str, field: &ValueIndexKey, ) -> Result<Option<Vec<(DocId, Value)>>>
Load a complete persisted index. None means this field has not been
built yet and the engine must backfill it from the document store once.
Sourcepub fn replace(
&self,
table: &str,
field: &ValueIndexKey,
values: &[(DocId, Value)],
) -> Result<()>
pub fn replace( &self, table: &str, field: &ValueIndexKey, values: &[(DocId, Value)], ) -> Result<()>
Atomically replace the complete persisted posting set and mark it built.
Sourcepub fn repair(
&self,
table: &str,
field: &ValueIndexKey,
stale_doc_ids: &[DocId],
missing: &[(DocId, Value)],
) -> Result<()>
pub fn repair( &self, table: &str, field: &ValueIndexKey, stale_doc_ids: &[DocId], missing: &[(DocId, Value)], ) -> Result<()>
Apply a sparse structural repair while retaining every valid posting. All ids and values are encoded before opening the savepoint so a range or serialization error cannot leave half of the delta applied.
Sourcepub fn replace_many(
&self,
table: &str,
indexes: &[(&ValueIndexKey, &[(DocId, Value)])],
) -> Result<()>
pub fn replace_many( &self, table: &str, indexes: &[(&ValueIndexKey, &[(DocId, Value)])], ) -> Result<()>
Atomically replace several complete posting sets for one table. Repair
paths commonly rebuild every indexed column together; one savepoint and
one set of prepared statements avoids repeating SQLite setup per field.
Sourcepub fn apply_unused_write(
&self,
table: &str,
doc_id: DocId,
values: &BTreeMap<ValueIndexKey, Value>,
namespace: DocumentIdNamespace,
) -> Result<()>
pub fn apply_unused_write( &self, table: &str, doc_id: DocId, values: &BTreeMap<ValueIndexKey, Value>, namespace: DocumentIdNamespace, ) -> Result<()>
Write the entries of a document whose identity no document of the table ever had in namespace, so that no entry of that identity exists to replace. The legacy tables replace by primary key either way.
Sourcepub fn apply_write(
&self,
table: &str,
doc_id: DocId,
values: Option<&BTreeMap<ValueIndexKey, Value>>,
) -> Result<()>
pub fn apply_write( &self, table: &str, doc_id: DocId, values: Option<&BTreeMap<ValueIndexKey, Value>>, ) -> Result<()>
Apply one document write to every persisted field currently loaded by
the engine. A replacement uses the (table, field, doc_id) primary key,
so updates never need a separate old-value delete.
pub fn drop_index(&self, table: &str, field: &ValueIndexKey) -> Result<()>
Sourcepub fn clear_table(&self, table: &str) -> Result<()>
pub fn clear_table(&self, table: &str) -> Result<()>
TRUNCATE keeps the index definitions but removes every posting.