Struct schemadb::DB [−][src]
pub struct DB { /* fields omitted */ }Expand description
This DB is a schematized RocksDB wrapper where all data passed in and out are typed according to
Schemas.
Implementations
Create db with all the column families provided if it doesn’t exist at path; Otherwise,
try to open it with all the column families.
pub fn open_readonly(
path: impl AsRef<Path>,
name: &'static str,
column_families: Vec<ColumnFamilyName>,
db_opts: &Options
) -> Result<Self>
pub fn open_readonly(
path: impl AsRef<Path>,
name: &'static str,
column_families: Vec<ColumnFamilyName>,
db_opts: &Options
) -> Result<Self>
Open db in readonly mode
Note that this still assumes there’s only one process that opens the same DB.
See open_as_secondary
pub fn open_as_secondary<P: AsRef<Path>>(
primary_path: P,
secondary_path: P,
name: &'static str,
column_families: Vec<ColumnFamilyName>,
db_opts: &Options
) -> Result<Self>
pub fn open_as_secondary<P: AsRef<Path>>(
primary_path: P,
secondary_path: P,
name: &'static str,
column_families: Vec<ColumnFamilyName>,
db_opts: &Options
) -> Result<Self>
Open db as secondary. This allows to read the DB in another process while it’s already opened for read / write in one (e.g. a Diem Node) https://github.com/facebook/rocksdb/blob/493f425e77043cc35ea2d89ee3c4ec0274c700cb/include/rocksdb/db.h#L176-L222
Reads single record by key.
Writes single record.
pub fn range_delete<S, SK>(&self, begin: &SK, end: &SK) -> Result<()> where
S: Schema,
SK: SeekKeyCodec<S>,
pub fn range_delete<S, SK>(&self, begin: &SK, end: &SK) -> Result<()> where
S: Schema,
SK: SeekKeyCodec<S>,
Delete all keys in range [begin, end).
SK has to be an explicit type parameter since
https://github.com/rust-lang/rust/issues/44721
Returns a forward SchemaIterator on a certain schema.
Returns a backward SchemaIterator on a certain schema.
Writes a group of records wrapped in a SchemaBatch.
Flushes all memtable data. This is only used for testing get_approximate_sizes_cf in unit
tests.