Skip to main content

Config

Struct Config 

Source
pub struct Config {
Show 15 fields pub graph_model: GraphModel, pub path: Option<PathBuf>, pub memory_limit: Option<usize>, pub spill_path: Option<PathBuf>, pub threads: usize, pub wal_enabled: bool, pub wal_flush_interval_ms: u64, pub backward_edges: bool, pub query_logging: bool, pub adaptive: AdaptiveConfig, pub factorized_execution: bool, pub wal_durability: DurabilityMode, pub schema_constraints: bool, pub query_timeout: Option<Duration>, pub gc_interval: usize,
}
Expand description

Database configuration.

Fields§

§graph_model: GraphModel

Graph data model (LPG or RDF). Immutable after database creation.

§path: Option<PathBuf>

Path to the database directory (None for in-memory only).

§memory_limit: Option<usize>

Memory limit in bytes (None for unlimited).

§spill_path: Option<PathBuf>

Path for spilling data to disk under memory pressure.

§threads: usize

Number of worker threads for query execution.

§wal_enabled: bool

Whether to enable WAL for durability.

§wal_flush_interval_ms: u64

WAL flush interval in milliseconds.

§backward_edges: bool

Whether to maintain backward edges.

§query_logging: bool

Whether to enable query logging.

§adaptive: AdaptiveConfig

Adaptive execution configuration.

§factorized_execution: bool

Whether to use factorized execution for multi-hop queries.

When enabled, consecutive MATCH expansions are executed using factorized representation which avoids Cartesian product materialization. This provides 5-100x speedup for multi-hop queries with high fan-out.

Enabled by default.

§wal_durability: DurabilityMode

WAL durability mode. Only used when wal_enabled is true.

§schema_constraints: bool

Whether to enable catalog schema constraint enforcement.

When true, the catalog enforces label, edge type, and property constraints (e.g. required properties, uniqueness). The server sets this for JSON Schema databases and populates constraints after creation.

§query_timeout: Option<Duration>

Maximum time a single query may run before being cancelled.

When set, the executor checks the deadline between operator batches and returns QueryError::timeout() if the wall-clock limit is exceeded. None means no timeout (queries may run indefinitely).

§gc_interval: usize

Run MVCC version garbage collection every N commits.

Old versions that are no longer visible to any active transaction are pruned to reclaim memory. Set to 0 to disable automatic GC.

Implementations§

Source§

impl Config

Source

pub fn in_memory() -> Config

Creates a new configuration for an in-memory database.

Source

pub fn persistent(path: impl Into<PathBuf>) -> Config

Creates a new configuration for a persistent database.

Source

pub fn with_memory_limit(self, limit: usize) -> Config

Sets the memory limit.

Source

pub fn with_threads(self, threads: usize) -> Config

Sets the number of worker threads.

Source

pub fn without_backward_edges(self) -> Config

Disables backward edges.

Source

pub fn with_query_logging(self) -> Config

Enables query logging.

Source

pub fn with_memory_fraction(self, fraction: f64) -> Config

Sets the memory budget as a fraction of system RAM.

Source

pub fn with_spill_path(self, path: impl Into<PathBuf>) -> Config

Sets the spill directory for out-of-core processing.

Source

pub fn with_adaptive(self, adaptive: AdaptiveConfig) -> Config

Sets the adaptive execution configuration.

Source

pub fn without_adaptive(self) -> Config

Disables adaptive execution.

Source

pub fn without_factorized_execution(self) -> Config

Disables factorized execution for multi-hop queries.

This reverts to the traditional flat execution model where each expansion creates a full Cartesian product. Only use this if you encounter issues with factorized execution.

Source

pub fn with_graph_model(self, model: GraphModel) -> Config

Sets the graph data model.

Source

pub fn with_wal_durability(self, mode: DurabilityMode) -> Config

Sets the WAL durability mode.

Source

pub fn with_schema_constraints(self) -> Config

Enables catalog schema constraint enforcement.

Source

pub fn with_query_timeout(self, timeout: Duration) -> Config

Sets the maximum time a query may run before being cancelled.

Source

pub fn with_gc_interval(self, interval: usize) -> Config

Sets the MVCC garbage collection interval (every N commits).

Set to 0 to disable automatic GC.

Source

pub fn validate(&self) -> Result<(), ConfigError>

Validates the configuration, returning an error for invalid combinations.

Called automatically by GrafeoDB::with_config().

§Errors

Returns ConfigError if any setting is invalid.

Trait Implementations§

Source§

impl Clone for Config

Source§

fn clone(&self) -> Config

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Config

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl Default for Config

Source§

fn default() -> Config

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more