pub struct DatabaseConfig {
pub memory_budget: usize,
pub disk_budget: usize,
pub spill_policy: SpillPolicy,
pub sql_mode: SqlMode,
pub columnar_cache_budget: usize,
}Expand description
Configuration for database resource budgets
Fields§
§memory_budget: usizeMaximum memory for indexes and buffer pools (bytes)
disk_budget: usizeMaximum disk space for database files (bytes)
spill_policy: SpillPolicyPolicy for handling memory budget violations
sql_mode: SqlModeSQL dialect compatibility mode (MySQL, SQLite, etc.)
columnar_cache_budget: usizeMaximum memory for columnar cache (bytes) Set to 0 to disable the columnar cache
Implementations§
Source§impl DatabaseConfig
impl DatabaseConfig
Sourcepub fn browser_default() -> Self
pub fn browser_default() -> Self
Default configuration for browser/WASM environments
- 512MB memory budget (conservative for browsers)
- 2GB disk budget (typical OPFS quota)
- SpillToDisk policy (automatic eviction)
- MySQL mode (default)
- 64MB columnar cache (modest for browser memory constraints)
Sourcepub fn server_default() -> Self
pub fn server_default() -> Self
Default configuration for server environments
- 16GB memory budget (abundant server RAM)
- 1TB disk budget (generous server storage)
- BestEffort policy (prefer memory, fall back to disk)
- MySQL mode (default)
- 256MB columnar cache (can cache all TPC-H tables at SF 1.0)
Sourcepub fn test_default() -> Self
pub fn test_default() -> Self
Minimal configuration for testing
- 10MB memory budget (force eviction quickly)
- 100MB disk budget
- SpillToDisk policy
- MySQL mode (default)
- 1MB columnar cache (tiny for testing eviction)
Trait Implementations§
Source§impl Clone for DatabaseConfig
impl Clone for DatabaseConfig
Source§fn clone(&self) -> DatabaseConfig
fn clone(&self) -> DatabaseConfig
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for DatabaseConfig
impl Debug for DatabaseConfig
Auto Trait Implementations§
impl Freeze for DatabaseConfig
impl RefUnwindSafe for DatabaseConfig
impl Send for DatabaseConfig
impl Sync for DatabaseConfig
impl Unpin for DatabaseConfig
impl UnwindSafe for DatabaseConfig
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
Mutably borrows from an owned value. Read more