pub struct Database { /* private fields */ }Expand description
Open OXGDB database handle.
§Performance
Moving a handle is O(n) for the owned in-memory database state.
Implementations§
Source§impl Database
impl Database
Sourcepub fn create(path: impl AsRef<Path>) -> Result<Self, DbError>
pub fn create(path: impl AsRef<Path>) -> Result<Self, DbError>
Creates a new empty OXGDB database at path.
§Errors
Returns DbError::AlreadyExists when a greenfield store already
exists, or DbError::Io when creation fails.
§Performance
This function is O(path length + empty store bytes).
Sourcepub fn status(&self) -> DatabaseStatus
pub fn status(&self) -> DatabaseStatus
Sourcepub fn catalog_summary(&self) -> CatalogSummary
pub fn catalog_summary(&self) -> CatalogSummary
Sourcepub fn begin_read(&self) -> ReadTransaction
pub fn begin_read(&self) -> ReadTransaction
Starts a read transaction pinned to the current visible generation.
§Performance
This method is O(database state size) because readers own immutable
snapshots.
Sourcepub fn begin_write(&mut self) -> Result<WriteTransaction<'_>, DbError>
pub fn begin_write(&mut self) -> Result<WriteTransaction<'_>, DbError>
Starts the single writer transaction.
§Errors
Returns DbError::TransactionIdOverflow when writer IDs are
exhausted.
§Performance
This method is O(database state size) because writes stage an owned
copy.
Sourcepub fn prepare(
&self,
language: QueryLanguage,
query: &str,
) -> Result<PreparedQuery, DbError>
pub fn prepare( &self, language: QueryLanguage, query: &str, ) -> Result<PreparedQuery, DbError>
Auto Trait Implementations§
impl Freeze for Database
impl RefUnwindSafe for Database
impl Send for Database
impl Sync for Database
impl Unpin for Database
impl UnsafeUnpin for Database
impl UnwindSafe for Database
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more