Struct intelli_shell::storage::SqliteStorage  
source · pub struct SqliteStorage { /* private fields */ }Expand description
SQLite-based storage
Implementations§
source§impl SqliteStorage
 
impl SqliteStorage
sourcepub fn new_in_memory() -> Result<Self>
 
pub fn new_in_memory() -> Result<Self>
Builds a new in-memory SQLite storage for testing purposes
sourcepub fn insert_command(&mut self, command: &mut Command) -> Result<bool>
 
pub fn insert_command(&mut self, command: &mut Command) -> Result<bool>
Inserts a command and updates its id with the inserted value.
If the command already exist on the database, its description will be updated.
Returns wether the command was inserted or not (updated)
sourcepub fn insert_commands(&mut self, commands: &mut [Command]) -> Result<u64>
 
pub fn insert_commands(&mut self, commands: &mut [Command]) -> Result<u64>
Inserts a bunch of commands and updates its id with the inserted value.
If any command already exist on the database, its description will be updated.
Returns the number of commands inserted (the rest are updated)
sourcepub fn update_command(&mut self, command: &Command) -> Result<bool>
 
pub fn update_command(&mut self, command: &Command) -> Result<bool>
Updates an existing command
Returns wether the command exists and was updated or not.
sourcepub fn delete_command(&mut self, command_id: i64) -> Result<bool>
 
pub fn delete_command(&mut self, command_id: i64) -> Result<bool>
Deletes an existing command
Returns wether the command exists and was updated or not.
sourcepub fn get_commands(&self, category: impl AsRef<str>) -> Result<Vec<Command>>
 
pub fn get_commands(&self, category: impl AsRef<str>) -> Result<Vec<Command>>
Get commands matching a category
sourcepub fn find_commands(&self, search: impl AsRef<str>) -> Result<Vec<Command>>
 
pub fn find_commands(&self, search: impl AsRef<str>) -> Result<Vec<Command>>
Finds commands matching the given search criteria