Skip to main content

CatalogEngine

Struct CatalogEngine 

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

Implementations§

Source§

impl CatalogEngine

Source

pub fn new<P: AsRef<Path>>(path: P) -> Result<Self>

Source

pub fn new_in_memory() -> Result<Self>

Source

pub fn read_database_header(&self) -> Result<Option<DatabaseHeader>>

Source

pub fn initialize_database_header( &mut self, schema_root_page: u32, ) -> Result<DatabaseHeader>

Source

pub fn allocate_table_id(&mut self) -> Result<TableId>

Source

pub fn set_next_table_id(&mut self, next_table_id: u32) -> Result<()>

Source

pub fn peek_next_table_id(&self) -> Result<TableId>

Source

pub fn update_database_header<F>(&mut self, update: F) -> Result<()>
where F: FnOnce(&mut DatabaseHeader),

Source

pub fn flush(&mut self) -> Result<()>

Source

pub fn journal_mode(&self) -> Result<JournalMode>

Source

pub fn set_journal_mode(&mut self, journal_mode: JournalMode) -> Result<()>

Source

pub fn checkpoint_wal(&mut self) -> Result<()>

Source

pub fn begin_transaction(&mut self) -> Result<()>

Source

pub fn commit_transaction(&mut self) -> Result<()>

Source

pub fn rollback_transaction(&mut self) -> Result<()>

Source

pub fn transaction_active(&self) -> Result<bool>

Source

pub fn snapshot(&self) -> Result<CatalogEngineSnapshot>

Source

pub fn restore_snapshot( &mut self, snapshot: CatalogEngineSnapshot, ) -> Result<()>

Source

pub fn get_storage_stats(&self) -> Result<CatalogStorageStats>

Source

pub fn create_table(&mut self, table_name: &str) -> Result<PageId>

Source

pub fn insert_into_table( &mut self, table_name: &str, row: Vec<Value>, ) -> Result<u64>

Source

pub fn replace_table_rows( &mut self, table_name: &str, rows: Vec<StoredRow>, ) -> Result<()>

Source

pub fn insert_row_with_rowid( &mut self, table_name: &str, row: StoredRow, ) -> Result<()>

Source

pub fn delete_from_table_by_rowid( &mut self, table_name: &str, rowid: u64, ) -> Result<bool>

Source

pub fn drop_table(&mut self, table_name: &str) -> Result<()>

Source

pub fn drop_table_with_indexes(&mut self, table: &Table) -> Result<()>

Source

pub fn open_table_cursor(&mut self, table_name: &str) -> Result<TableCursor>

Source

pub fn read_rows_with_ids(&mut self, table_name: &str) -> Result<Vec<StoredRow>>

Source

pub fn read_from_table(&mut self, table_name: &str) -> Result<Vec<Vec<Value>>>

Source

pub fn lookup_row_by_rowid( &mut self, table_name: &str, rowid: u64, ) -> Result<Option<StoredRow>>

Source

pub fn lookup_row_by_primary_key( &mut self, table: &Table, key_values: &[Value], ) -> Result<Option<StoredRow>>

Source

pub fn lookup_primary_key_rowid( &mut self, table: &Table, key_values: &[Value], ) -> Result<Option<u64>>

Source

pub fn register_primary_key_row( &mut self, table: &Table, row: StoredRow, ) -> Result<()>

Source

pub fn lookup_rows_by_secondary_index( &mut self, table: &Table, index_name: &str, key_values: &[Value], ) -> Result<Vec<StoredRow>>

Source

pub fn lookup_secondary_index_rowids( &mut self, table: &Table, index_name: &str, key_values: &[Value], ) -> Result<Vec<u64>>

Source

pub fn register_secondary_index_row( &mut self, table: &Table, row: StoredRow, ) -> Result<()>

Source

pub fn rebuild_primary_key_index( &mut self, table: &Table, rows: &[StoredRow], ) -> Result<()>

Source

pub fn rebuild_secondary_indexes( &mut self, table: &Table, rows: &[StoredRow], ) -> Result<()>

Source

pub fn delete_primary_key_row( &mut self, table: &Table, row: &StoredRow, ) -> Result<bool>

Source

pub fn delete_secondary_index_row( &mut self, table: &Table, row: &StoredRow, ) -> Result<()>

Source

pub fn encode_primary_key(&self, key_values: &[Value]) -> Result<Vec<u8>>

Source

pub fn encode_secondary_index_key( &self, key_values: &[Value], ) -> Result<Vec<u8>>

Source

pub fn open_primary_key_cursor(&mut self, table: &Table) -> Result<IndexCursor>

Source

pub fn open_secondary_index_cursor( &mut self, table: &Table, index_name: &str, ) -> Result<IndexCursor>

Source

pub fn validate_table_indexes(&mut self, table: &Table) -> Result<()>

Source

pub fn validate_integrity(&mut self) -> Result<CatalogIntegrityReport>

Trait Implementations§

Source§

impl Debug for CatalogEngine

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. 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> 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, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.