Crate sov_schema_db
source ·Expand description
This library implements a schematized DB on top of RocksDB. It makes sure all data passed in and out are structured according to predefined schemas and prevents access to raw keys and values. This library also enforces a set of specific DB options, like custom comparators and schema-to-column-family mapping.
It requires that different kinds of key-value pairs be stored in separate column
families. To use this library to store a kind of key-value pairs, the user needs to use the
define_schema!
macro to define the schema name, the types of key and value, and name of the
column family.
Re-exports
pub use crate::schema::Schema;
Modules
- A type-safe interface over
DB
column families.
Macros
Structs
- This DB is a schematized RocksDB wrapper where all data passed in and out are typed according to
Schema
s. SchemaBatch
holds a collection of updates that can be applied to a DB (Schema
) atomically. The updates will be applied in the order in which they are added to theSchemaBatch
.- DB Iterator parameterized on
Schema
that seeks withSchema::Key
and yieldsSchema::Key
andSchema::Value
pairs.
Enums
- An error that occurred during (de)serialization of a
Schema
’s keys or values.
Constants
- The name of the default column family.
Traits
- This defines a type that can be used to seek a
SchemaIterator
, via interfaces likeSchemaIterator::seek
. Mind you, not allKeyEncoder
s shall beSeekKeyEncoder
s, and vice versa. E.g.: