pub struct PersistedEngine { /* private fields */ }Expand description
持久化存储引擎 包装 MemoryEngine + PersistenceManager,提供 WAL 日志功能
Implementations§
Source§impl PersistedEngine
impl PersistedEngine
Sourcepub fn inner_arc(&self) -> Arc<RwLock<MemoryEngine>>
pub fn inner_arc(&self) -> Arc<RwLock<MemoryEngine>>
获取内部 MemoryEngine 的 Arc 克隆(用于 QueryBuilder 等)
Sourcepub fn checkpoint(&mut self) -> DbResult<()>
pub fn checkpoint(&mut self) -> DbResult<()>
手动触发检查点
Sourcepub fn force_checkpoint(&mut self) -> DbResult<()>
pub fn force_checkpoint(&mut self) -> DbResult<()>
强制触发检查点(无论 WAL 大小)
Sourcepub fn create_composite_index(
&mut self,
table: &str,
columns: &[&str],
) -> DbResult<()>
pub fn create_composite_index( &mut self, table: &str, columns: &[&str], ) -> DbResult<()>
创建复合索引
Sourcepub fn create_unique_index(
&mut self,
table: &str,
columns: &[&str],
) -> DbResult<()>
pub fn create_unique_index( &mut self, table: &str, columns: &[&str], ) -> DbResult<()>
创建唯一复合索引
Sourcepub fn drop_composite_index(
&mut self,
table: &str,
columns: &[&str],
) -> DbResult<bool>
pub fn drop_composite_index( &mut self, table: &str, columns: &[&str], ) -> DbResult<bool>
删除复合索引
Sourcepub fn has_composite_index(&self, table: &str, columns: &[&str]) -> bool
pub fn has_composite_index(&self, table: &str, columns: &[&str]) -> bool
检查复合索引是否存在
Trait Implementations§
Source§impl StorageEngine for PersistedEngine
impl StorageEngine for PersistedEngine
Source§fn create_table(&mut self, schema: TableSchema) -> DbResult<()>
fn create_table(&mut self, schema: TableSchema) -> DbResult<()>
创建表
Source§fn get_schema(&self, name: &str) -> DbResult<TableSchema>
fn get_schema(&self, name: &str) -> DbResult<TableSchema>
获取表 schema(返回克隆,支持锁守卫场景)
Auto Trait Implementations§
impl Freeze for PersistedEngine
impl RefUnwindSafe for PersistedEngine
impl Send for PersistedEngine
impl Sync for PersistedEngine
impl Unpin for PersistedEngine
impl UnsafeUnpin for PersistedEngine
impl UnwindSafe for PersistedEngine
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