pub struct Database { /* private fields */ }Implementations§
Source§impl Database
impl Database
pub fn create(path: impl Into<PathBuf>, passphrase: &str) -> Result<Self>
pub fn open(path: impl Into<PathBuf>, passphrase: &str) -> Result<Self>
pub fn commit(&mut self) -> Result<()>
pub fn create_table( &mut self, name: &str, columns: Vec<(&str, ColumnType)>, ) -> Result<()>
pub fn drop_table(&mut self, name: &str) -> Result<()>
pub fn list_tables(&self) -> Vec<String>
pub fn table_schema(&self, name: &str) -> Result<Vec<(String, ColumnType)>>
pub fn insert(&mut self, table: &str, row: Vec<Value>) -> Result<()>
pub fn select( &self, table: &str, columns: Option<Vec<&str>>, filter: Option<&dyn Fn(&[Value]) -> bool>, ) -> Result<Vec<Vec<Value>>>
pub fn update( &mut self, table: &str, filter: &dyn Fn(&[Value]) -> bool, set_col: &str, new_val: Value, ) -> Result<usize>
pub fn delete( &mut self, table: &str, filter: &dyn Fn(&[Value]) -> bool, ) -> Result<usize>
pub fn logs(&self) -> &[LogEntry]
pub fn export_json(&self) -> Result<String>
pub fn export_table( &self, table: &str, format: ExportFormat, encrypt: bool, passphrase: Option<&str>, ) -> Result<Vec<u8>>
pub fn import_table( &mut self, table_name: &str, data: &[u8], format: ExportFormat, encrypted: bool, passphrase: Option<&str>, ) -> Result<()>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Database
impl RefUnwindSafe for Database
impl Send for Database
impl Sync for Database
impl Unpin for Database
impl UnsafeUnpin for Database
impl UnwindSafe for Database
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