Skip to main content

FlightBackend

Trait FlightBackend 

Source
pub trait FlightBackend: Send + Sync {
    // Required methods
    fn prepare<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        call: &'life1 CallContext,
        sql: &'life2 str,
        range: Option<TimeRange>,
    ) -> Pin<Box<dyn Future<Output = Result<QueryEstimate>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;
    fn execute<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        call: &'life1 CallContext,
        sql: &'life2 str,
        range: Option<TimeRange>,
        row_limit: usize,
    ) -> Pin<Box<dyn Future<Output = Result<BoxStream<'static, Result<RecordBatch>>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;
}
Expand description

The FlightSQL operations the query tools need. A seam so the tools can be tested without a server.

Required Methods§

Source

fn prepare<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, call: &'life1 CallContext, sql: &'life2 str, range: Option<TimeRange>, ) -> Pin<Box<dyn Future<Output = Result<QueryEstimate>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Plans the query without running it.

Source

fn execute<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, call: &'life1 CallContext, sql: &'life2 str, range: Option<TimeRange>, row_limit: usize, ) -> Pin<Box<dyn Future<Output = Result<BoxStream<'static, Result<RecordBatch>>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Starts the query, asking the server for at most row_limit rows. Dropping the stream cancels it.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§