pub struct LocalEngine { /* private fields */ }Expand description
Local DuckDB engine wrapper for the HatiData CLI.
Implementations§
Source§impl LocalEngine
impl LocalEngine
Sourcepub fn execute_query(&self, sql: &str) -> Result<QueryResult>
pub fn execute_query(&self, sql: &str) -> Result<QueryResult>
Execute a SQL query and return structured results.
IMPORTANT DuckDB 1.4.4 API note: column_count() and column_name()
panic if called before the statement is executed. We must execute first
(via query), then read column metadata.
Uses duckdb::types::Value for reading cell values to handle all types
correctly (the DuckDB Rust API’s row.get::<_, String>(i) fails for
non-String types).
Sourcepub fn list_tables(&self) -> Result<Vec<TableInfo>>
pub fn list_tables(&self) -> Result<Vec<TableInfo>>
List all user tables in the database.
Sourcepub fn table_row_count(&self, table: &str) -> Result<u64>
pub fn table_row_count(&self, table: &str) -> Result<u64>
Get the row count for a specific table.
Auto Trait Implementations§
impl !Freeze for LocalEngine
impl !RefUnwindSafe for LocalEngine
impl Send for LocalEngine
impl !Sync for LocalEngine
impl Unpin for LocalEngine
impl !UnwindSafe for LocalEngine
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