pub struct SharedDuckDbEngine(pub Arc<DuckDbEngine>);Expand description
Arc-wrapped DuckDbEngine that implements rhei_core::OlapEngine.
This newtype sidesteps the Rust orphan rule that would prevent writing
impl OlapEngine for Arc<DuckDbEngine> (both Arc and OlapEngine are
defined in foreign crates). Use SharedDuckDbEngine wherever you need
cheap clones of a shared engine handle — for example when passing the engine
to multiple background tasks.
All trait methods delegate to the inner DuckDbEngine with zero overhead.
The Deref implementation gives direct access to DuckDbEngine methods.
Tuple Fields§
§0: Arc<DuckDbEngine>Implementations§
Sourcepub fn new(engine: DuckDbEngine) -> Self
pub fn new(engine: DuckDbEngine) -> Self
Wrap engine in an Arc, producing a cheaply cloneable handle.
Methods from Deref<Target = DuckDbEngine>§
Sourcepub fn read_pool_size(&self) -> usize
pub fn read_pool_size(&self) -> usize
Return the number of read connections in the pool.
Always at least 1 (pool size is clamped at construction time).
Trait Implementations§
Source§fn clone(&self) -> SharedDuckDbEngine
fn clone(&self) -> SharedDuckDbEngine
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§fn deref(&self) -> &Self::Target
fn deref(&self) -> &Self::Target
Dereferences to the inner DuckDbEngine.
Source§type Target = DuckDbEngine
type Target = DuckDbEngine
Source§async fn query(&self, sql: &str) -> Result<Vec<RecordBatch>, Self::Error>
async fn query(&self, sql: &str) -> Result<Vec<RecordBatch>, Self::Error>
Delegates to DuckDbEngine::query.
Source§async fn execute(&self, sql: &str) -> Result<u64, Self::Error>
async fn execute(&self, sql: &str) -> Result<u64, Self::Error>
Delegates to DuckDbEngine::execute.
Source§async fn load_arrow(
&self,
table: &str,
batches: &[RecordBatch],
) -> Result<u64, Self::Error>
async fn load_arrow( &self, table: &str, batches: &[RecordBatch], ) -> Result<u64, Self::Error>
Delegates to DuckDbEngine::load_arrow.
Source§async fn create_table(
&self,
table_name: &str,
schema: &SchemaRef,
primary_key: &[String],
) -> Result<(), Self::Error>
async fn create_table( &self, table_name: &str, schema: &SchemaRef, primary_key: &[String], ) -> Result<(), Self::Error>
Delegates to DuckDbEngine::create_table.
Source§async fn table_exists(&self, table_name: &str) -> Result<bool, Self::Error>
async fn table_exists(&self, table_name: &str) -> Result<bool, Self::Error>
Delegates to DuckDbEngine::table_exists.
Source§async fn add_column(
&self,
table_name: &str,
column_name: &str,
data_type: &DataType,
) -> Result<(), Self::Error>
async fn add_column( &self, table_name: &str, column_name: &str, data_type: &DataType, ) -> Result<(), Self::Error>
Delegates to DuckDbEngine::add_column.
Source§async fn drop_column(
&self,
table_name: &str,
column_name: &str,
) -> Result<(), Self::Error>
async fn drop_column( &self, table_name: &str, column_name: &str, ) -> Result<(), Self::Error>
Delegates to DuckDbEngine::drop_column.
Source§fn supports_transactions(&self) -> bool
fn supports_transactions(&self) -> bool
Delegates to DuckDbEngine::supports_transactions.