pub enum Database {
SQLite(SqliteBackend),
DuckDB(DuckdbBackend),
}Variants§
SQLite(SqliteBackend)
DuckDB(DuckdbBackend)
Implementations§
Source§impl Database
impl Database
pub fn open(path: &str) -> Result<Self, String>
pub fn path(&self) -> &str
pub fn get_info(&self) -> Result<DbInfo, String>
pub fn list_tables(&self) -> Result<Vec<TableInfo>, String>
pub fn list_views(&self) -> Result<Vec<String>, String>
pub fn list_indexes(&self) -> Result<Vec<IndexInfo>, String>
pub fn get_schema(&self, table: &str) -> Result<Vec<ColumnInfo>, String>
pub fn query_table( &self, table: &str, limit: usize, offset: usize, sort: Option<Sort>, ) -> Result<QueryResult, String>
pub fn run_query(&self, sql: &str) -> Result<QueryResult, String>
pub fn get_row_count(&self, table: &str) -> Result<u64, String>
Sourcepub fn export_csv<W: Write>(
&self,
table: &str,
sort: Option<Sort>,
writer: &mut W,
) -> Result<(), String>
pub fn export_csv<W: Write>( &self, table: &str, sort: Option<Sort>, writer: &mut W, ) -> Result<(), String>
Writes the whole table, in the order it is being viewed in. The page window is deliberately not applied: exporting the fifty rows that happen to be on screen out of thousands is not what the button appears to do.
Neither this nor the query export touches anything specific to a backend, so both live here rather than being written twice.
Auto Trait Implementations§
impl !Freeze for Database
impl !RefUnwindSafe for Database
impl !Sync for Database
impl !UnwindSafe for Database
impl Send for Database
impl Unpin for Database
impl UnsafeUnpin 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