Skip to main content

Crate marsdb_storage

Crate marsdb_storage 

Source
Expand description

Thin trait boundary over redb. marsdb-graph talks to this crate, never to redb directly, so the underlying embedded KV engine could be swapped without touching graph/query code. (A hand-rolled replacement engine was prototyped and abandoned – redb stays; the boundary remains because it costs nothing and keeps the dependency surface honest.)

Modules§

tables

Structs§

MultimapTableDefinition
Defines the name and types of a multimap table
ReadTransaction
A read-only transaction
StorageEngine
TableDefinition
Defines the name and types of a table
WriteTransaction
A read/write transaction

Enums§

MultimapTableHandle
StorageError
TableHandle
Exposes get/iter/range as plain inherent methods, not a full redb::ReadableTable trait impl — matching the whole trait (first/ last/…) would be boilerplate for methods nothing calls. range was deliberately left out until a real call site needed it; v2’s composite-key adjacency (prefix scans over ADJ_OUT/ADJ_IN) is that call site.
Txn
Either kind of redb transaction — lets a function that only ever reads (.get()/.iter(), never .insert()/.remove()) run against a real WriteTransaction (the crash-safety boundary for a write statement) or a ReadTransaction (so a read-only statement doesn’t have to contend for redb’s single-writer lock at all). WriteTransaction/ ReadTransaction share no common trait in redb itself — open_table/ open_multimap_table are inherent methods on two unrelated structs, returning different concrete types (Table/ReadOnlyTable, MultimapTable/ReadOnlyMultimapTable) — so this (and TableHandle/ MultimapTableHandle below) is a small local abstraction over that, not something redb provides.

Constants§

CURRENT_FORMAT_VERSION
Version of the MarsDB-owned tables and record encodings. This is separate from redb’s own file-format version.
OLDEST_SUPPORTED_FORMAT_VERSION

Traits§

ReadableDatabase
ReadableMultimapTable
ReadableTable
ReadableTableMetadata