pub struct MemoryDatabase { /* private fields */ }Expand description
In-memory database implementation for testing and development.
This provides a simple in-memory store that implements the SchemaDatabase trait without requiring external database dependencies. Useful for:
- Testing
- Development
- Small-scale applications
- Temporary storage
Implementations§
Trait Implementations§
Source§impl Default for MemoryDatabase
impl Default for MemoryDatabase
Source§impl SchemaDatabase for MemoryDatabase
impl SchemaDatabase for MemoryDatabase
Source§fn store_schema(
&mut self,
name: &str,
table: &SymbolTable,
) -> Result<SchemaId, AdapterError>
fn store_schema( &mut self, name: &str, table: &SymbolTable, ) -> Result<SchemaId, AdapterError>
Store a complete symbol table in the database. Read more
Source§fn load_schema(&self, id: SchemaId) -> Result<SymbolTable, AdapterError>
fn load_schema(&self, id: SchemaId) -> Result<SymbolTable, AdapterError>
Load a symbol table by schema ID.
Source§fn load_schema_by_name(&self, name: &str) -> Result<SymbolTable, AdapterError>
fn load_schema_by_name(&self, name: &str) -> Result<SymbolTable, AdapterError>
Load a symbol table by name (returns most recent version).
Source§fn list_schemas(&self) -> Result<Vec<SchemaMetadata>, AdapterError>
fn list_schemas(&self) -> Result<Vec<SchemaMetadata>, AdapterError>
List all available schemas.
Source§fn delete_schema(&mut self, id: SchemaId) -> Result<(), AdapterError>
fn delete_schema(&mut self, id: SchemaId) -> Result<(), AdapterError>
Delete a schema by ID.
Source§fn search_schemas(
&self,
pattern: &str,
) -> Result<Vec<SchemaMetadata>, AdapterError>
fn search_schemas( &self, pattern: &str, ) -> Result<Vec<SchemaMetadata>, AdapterError>
Search schemas by name pattern.
Source§fn get_schema_history(
&self,
name: &str,
) -> Result<Vec<SchemaVersion>, AdapterError>
fn get_schema_history( &self, name: &str, ) -> Result<Vec<SchemaVersion>, AdapterError>
Get schema history (all versions).
Auto Trait Implementations§
impl Freeze for MemoryDatabase
impl RefUnwindSafe for MemoryDatabase
impl Send for MemoryDatabase
impl Sync for MemoryDatabase
impl Unpin for MemoryDatabase
impl UnwindSafe for MemoryDatabase
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