Skip to main content

QueryStorage

Trait QueryStorage 

Source
pub trait QueryStorage:
    GraphStore
    + CatalogStore
    + StorageAuthOps
    + StorageAdmin
    + StoragePersistenceOps
    + ColumnStatsReader
    + AutoCommitBatchOps
    + AutoCommitGroupOps {
    // Provided methods
    fn snapshot_handle(&self) -> Option<SnapshotHandle> { ... }
    fn export_space(&self, space: &str, path: &Path) -> Result<(), StorageError> { ... }
    fn import_space(
        &mut self,
        space: &str,
        path: &Path,
    ) -> Result<(), StorageError> { ... }
}
Expand description

Minimal combined capability required by the query crate.

Provided Methods§

Source

fn snapshot_handle(&self) -> Option<SnapshotHandle>

Snapshot handle bound to this storage handle, when the handle is bound to an operation context with a pinned read/write snapshot.

Always reports the operation context’s read timestamp: storage reads execute at the read timestamp, so reporting it tells the truth about the observed snapshot. (Write contexts additionally pin a write timestamp for visibility ordering, but reads never execute at it; reporting it here made read-committed statements look inconsistent after a statement refresh moved the read stamp past the write stamp.) Unbound handles (raw global storage) return None. This lets the query layer observe which snapshot a per-query bound handle reads at, without reaching into the storage internals.

Snapshot truth lives in the global tracker, so the handle is always synthesized from the pinned timestamp (id = 0).

Source

fn export_space(&self, space: &str, path: &Path) -> Result<(), StorageError>

Export the given space to CSV files under path/<space_name>/.

Each tag produces a <tag>.csv file; each edge type produces a <edge_type>.csv file. A schema.json metadata file records the space, tags, and edge types with their property schemas.

Source

fn import_space(&mut self, space: &str, path: &Path) -> Result<(), StorageError>

Import a space from CSV files under path/<space_name>/.

Expects a schema.json metadata file and <tag>.csv / <edge_type>.csv data files.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§