Skip to main content

OptimisticTransactionDB

Type Alias OptimisticTransactionDB 

Source
pub type OptimisticTransactionDB<T = MultiThreaded> = DBCommon<T, OptimisticTransactionDBInner>;
Available on crate feature multi-threaded-cf only.

Aliased Type§

pub struct OptimisticTransactionDB<T = MultiThreaded> { /* private fields */ }

Implementations§

Source§

impl<T: ThreadMode> OptimisticTransactionDB<T>

Methods of OptimisticTransactionDB.

Source

pub fn open_default<P: AsRef<Path>>(path: P) -> Result<Self, Error>

Opens a database with default options.

Source

pub fn open<P: AsRef<Path>>(opts: &Options, path: P) -> Result<Self, Error>

Opens the database with the specified options.

Source

pub fn open_cf<P, I, N>(opts: &Options, path: P, cfs: I) -> Result<Self, Error>
where P: AsRef<Path>, I: IntoIterator<Item = N>, N: AsRef<str>,

Opens a database with the given database options and column family names.

Column families opened using this function will be created with default Options. NOTE: default column family will be opened with the Options::default(). If you want to open default column family with custom options, use open_cf_descriptors and provide a ColumnFamilyDescriptor with the desired options.

Source

pub fn open_cf_descriptors<P, I>( opts: &Options, path: P, cfs: I, ) -> Result<Self, Error>

Opens a database with the given database options and column family descriptors.

Source

pub fn transaction(&self) -> Transaction<'_, Self>

Creates a transaction with default options.

Source

pub fn transaction_opt( &self, writeopts: &WriteOptions, otxn_opts: &OptimisticTransactionOptions, ) -> Transaction<'_, Self>

Creates a transaction with default options.

Source

pub fn write_opt( &self, batch: &WriteBatchWithTransaction<true>, writeopts: &WriteOptions, ) -> Result<(), Error>

Source

pub fn write( &self, batch: &WriteBatchWithTransaction<true>, ) -> Result<(), Error>

Source

pub fn write_without_wal( &self, batch: &WriteBatchWithTransaction<true>, ) -> Result<(), Error>

Source

pub fn delete_range_cf_opt<K: AsRef<[u8]>>( &self, cf: &impl AsColumnFamilyRef, from: K, to: K, writeopts: &WriteOptions, ) -> Result<(), Error>

Removes the database entries in the range ["from", "to") using given write options.

Source

pub fn delete_range_cf<K: AsRef<[u8]>>( &self, cf: &impl AsColumnFamilyRef, from: K, to: K, ) -> Result<(), Error>

Removes the database entries in the range ["from", "to") using default write options.

Trait Implementations§

Source§

impl<T: ThreadMode> AsRawPtr<rocksdb_t> for OptimisticTransactionDB<T>

Available on crate feature raw-ptr only.
Source§

unsafe fn as_raw_ptr(&self) -> *mut rocksdb_t

Returns a raw pointer to the underlying rocksdb_t (base DB) object.

This allows direct access to the RocksDB C API for advanced use cases such as verifying file checksums.