Skip to main content

SQLiteBTreeIndexStore

Struct SQLiteBTreeIndexStore 

Source
pub struct SQLiteBTreeIndexStore { /* private fields */ }

Implementations§

Source§

impl SQLiteBTreeIndexStore

Source

pub fn new(conn: ManagedConnection) -> Self

Source

pub fn fields(&self, table: &str) -> Result<Vec<ValueIndexKey>>

Source

pub fn repairs(&self) -> Result<Vec<(String, ValueIndexKey)>>

Source

pub fn clear_repair(&self, table: &str, field: &ValueIndexKey) -> Result<()>

Source

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.

Source

pub fn replace( &self, table: &str, field: &ValueIndexKey, values: &[(DocId, Value)], ) -> Result<()>

Atomically replace the complete persisted posting set and mark it built.

Source

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.

Source

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.

Source

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.

Source

pub fn drop_index(&self, table: &str, field: &ValueIndexKey) -> Result<()>

Source

pub fn clear_table(&self, table: &str) -> Result<()>

TRUNCATE keeps the index definitions but removes every posting.

Trait Implementations§

Source§

impl Clone for SQLiteBTreeIndexStore

Source§

fn clone(&self) -> SQLiteBTreeIndexStore

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.