pub struct WalOptimizer { /* private fields */ }Expand description
WAL optimizer for database performance tuning
Implementations§
Source§impl WalOptimizer
impl WalOptimizer
Sourcepub fn new(config: WalConfig) -> Self
pub fn new(config: WalConfig) -> Self
Create a new WAL optimizer with the specified configuration
Sourcepub fn optimize_connection(
&self,
conn: &SqliteConnection,
) -> Result<(), EventualiError>
pub fn optimize_connection( &self, conn: &SqliteConnection, ) -> Result<(), EventualiError>
Apply WAL optimizations to a database connection
Sourcepub fn checkpoint(
&mut self,
conn: &SqliteConnection,
) -> Result<(), EventualiError>
pub fn checkpoint( &mut self, conn: &SqliteConnection, ) -> Result<(), EventualiError>
Perform a manual WAL checkpoint
Sourcepub fn get_stats(
&self,
conn: &SqliteConnection,
) -> Result<WalStats, EventualiError>
pub fn get_stats( &self, conn: &SqliteConnection, ) -> Result<WalStats, EventualiError>
Get current WAL statistics
Sourcepub fn needs_checkpoint(&self) -> bool
pub fn needs_checkpoint(&self) -> bool
Check if a checkpoint is needed based on configuration
Sourcepub fn get_config(&self) -> &WalConfig
pub fn get_config(&self) -> &WalConfig
Get the current configuration
Auto Trait Implementations§
impl Freeze for WalOptimizer
impl RefUnwindSafe for WalOptimizer
impl Send for WalOptimizer
impl Sync for WalOptimizer
impl Unpin for WalOptimizer
impl UnwindSafe for WalOptimizer
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
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>
Converts
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>
Converts
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 more