pub struct RedDBOptions {Show 20 fields
pub mode: StorageMode,
pub data_path: Option<PathBuf>,
pub read_only: bool,
pub create_if_missing: bool,
pub verify_checksums: bool,
pub durability_mode: DurabilityMode,
pub group_commit: GroupCommitOptions,
pub auto_checkpoint_pages: u32,
pub cache_pages: usize,
pub snapshot_retention: usize,
pub export_retention: usize,
pub feature_gates: CapabilitySet,
pub force_create: bool,
pub metadata: BTreeMap<String, String>,
pub remote_backend: Option<Arc<dyn RemoteBackend>>,
pub remote_backend_atomic: Option<Arc<dyn AtomicRemoteBackend>>,
pub remote_key: Option<String>,
pub replication: ReplicationConfig,
pub auth: AuthConfig,
pub auto_index_id: bool,
}Fields§
§mode: StorageMode§data_path: Option<PathBuf>§read_only: bool§create_if_missing: bool§verify_checksums: bool§durability_mode: DurabilityMode§group_commit: GroupCommitOptions§auto_checkpoint_pages: u32§cache_pages: usize§snapshot_retention: usize§export_retention: usize§feature_gates: CapabilitySet§force_create: bool§metadata: BTreeMap<String, String>§remote_backend: Option<Arc<dyn RemoteBackend>>Optional remote storage backend for snapshot transport.
remote_backend_atomic: Option<Arc<dyn AtomicRemoteBackend>>Optional CAS-capable handle to the same backend, populated by
the factory when the configured backend implements
AtomicRemoteBackend (S3/local always; HTTP only when
RED_HTTP_CONDITIONAL_WRITES=true). None for backends that
do not provide compare-and-swap (Turso, D1, plain HTTP).
LeaseStore and any future CAS consumer pull from this field.
remote_key: Option<String>Remote object key used by the remote backend.
replication: ReplicationConfigReplication configuration.
auth: AuthConfigAuthentication & authorization configuration.
auto_index_id: boolAuto-create a HASH index on a user id column the first time a
row carrying that column is inserted into a collection. See
UnifiedStoreConfig::auto_index_id. Defaults to true; set to
false to opt out per workload (e.g. ingest pipelines that
don’t need point-lookups by id).
Implementations§
Source§impl RedDBOptions
impl RedDBOptions
pub fn persistent<P>(path: P) -> RedDBOptions
Sourcepub fn in_memory() -> RedDBOptions
pub fn in_memory() -> RedDBOptions
Ephemeral, tempfile-backed database.
The underlying storage is a real persistent file placed under the system
temp directory with a unique name — there is no longer a true in-memory
execution mode. Prefer RedDBOptions::persistent when the data should
outlive the process.
pub fn with_mode(self, mode: StorageMode) -> RedDBOptions
pub fn with_data_path<P>(self, path: P) -> RedDBOptions
pub fn with_read_only(self, read_only: bool) -> RedDBOptions
pub fn with_auto_checkpoint(self, pages: u32) -> RedDBOptions
pub fn with_durability_mode(self, mode: DurabilityMode) -> RedDBOptions
pub fn with_group_commit_window_ms(self, window_ms: u64) -> RedDBOptions
pub fn with_group_commit_max_statements( self, max_statements: usize, ) -> RedDBOptions
pub fn with_group_commit_max_wal_bytes(self, max_wal_bytes: u64) -> RedDBOptions
pub fn with_cache_pages(self, pages: usize) -> RedDBOptions
pub fn with_snapshot_retention(self, limit: usize) -> RedDBOptions
pub fn with_export_retention(self, limit: usize) -> RedDBOptions
pub fn with_metadata<K, V>(self, key: K, value: V) -> RedDBOptions
Sourcepub fn with_auto_index_id(self, enabled: bool) -> RedDBOptions
pub fn with_auto_index_id(self, enabled: bool) -> RedDBOptions
Toggle the implicit HASH index on user id columns at first
insert (#112). Defaults to enabled — pass false to fall back
to the legacy “scan unless CREATE INDEX is issued” behaviour.
pub fn with_capability(self, capability: Capability) -> RedDBOptions
Sourcepub fn with_remote_backend(
self,
backend: Arc<dyn RemoteBackend>,
key: impl Into<String>,
) -> RedDBOptions
pub fn with_remote_backend( self, backend: Arc<dyn RemoteBackend>, key: impl Into<String>, ) -> RedDBOptions
Attach a remote storage backend for snapshot transport.
On open, the database snapshot is downloaded from the remote key
to the local data path. On flush, the local file is uploaded back
to the remote backend under the same key.
Sourcepub fn with_atomic_remote_backend(
self,
backend: Arc<dyn AtomicRemoteBackend>,
) -> RedDBOptions
pub fn with_atomic_remote_backend( self, backend: Arc<dyn AtomicRemoteBackend>, ) -> RedDBOptions
Attach a CAS-capable backend handle. Pass the same Arc as
with_remote_backend (factories should construct the backend
once and call both setters); this method exists so the type
system, not runtime config, decides whether LeaseStore is
reachable.
pub fn with_replication(self, config: ReplicationConfig) -> RedDBOptions
pub fn with_auth(self, config: AuthConfig) -> RedDBOptions
pub fn resolved_path(&self, fallback: impl AsRef<Path>) -> PathBuf
pub fn remote_namespace_prefix(&self) -> String
pub fn default_backup_head_key(&self) -> String
pub fn default_snapshot_prefix(&self) -> String
pub fn default_wal_archive_prefix(&self) -> String
pub fn has_capability(&self, capability: Capability) -> bool
Trait Implementations§
Source§impl Clone for RedDBOptions
impl Clone for RedDBOptions
Source§fn clone(&self) -> RedDBOptions
fn clone(&self) -> RedDBOptions
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for RedDBOptions
impl Debug for RedDBOptions
Source§impl Default for RedDBOptions
impl Default for RedDBOptions
Source§fn default() -> RedDBOptions
fn default() -> RedDBOptions
Auto Trait Implementations§
impl Freeze for RedDBOptions
impl !RefUnwindSafe for RedDBOptions
impl Send for RedDBOptions
impl Sync for RedDBOptions
impl Unpin for RedDBOptions
impl UnsafeUnpin for RedDBOptions
impl !UnwindSafe for RedDBOptions
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request