Skip to main content

SqlQueryHandler

Trait SqlQueryHandler 

Source
pub trait SqlQueryHandler {
    // Required methods
    fn do_query<'life0, 'life1, 'async_trait>(
        &'life0 self,
        query: &'life1 str,
        query_ctx: QueryContextRef,
    ) -> Pin<Box<dyn Future<Output = Vec<Result<Output>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn do_analyze_stream_query<'life0, 'life1, 'async_trait>(
        &'life0 self,
        query: &'life1 str,
        query_ctx: QueryContextRef,
    ) -> Pin<Box<dyn Future<Output = Result<Output>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn do_exec_plan<'life0, 'async_trait>(
        &'life0 self,
        plan: LogicalPlan,
        stmt: Option<Statement>,
        query_ctx: QueryContextRef,
    ) -> Pin<Box<dyn Future<Output = Result<Output>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn do_promql_query<'life0, 'life1, 'async_trait>(
        &'life0 self,
        query: &'life1 PromQuery,
        query_ctx: QueryContextRef,
    ) -> Pin<Box<dyn Future<Output = Vec<Result<Output>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn do_describe<'life0, 'async_trait>(
        &'life0 self,
        stmt: Statement,
        query_ctx: QueryContextRef,
    ) -> Pin<Box<dyn Future<Output = Result<Option<DescribeResult>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn is_valid_schema<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        catalog: &'life1 str,
        schema: &'life2 str,
    ) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;

    // Provided methods
    fn supports_metric_batch_ddl(&self) -> bool { ... }
    fn create_logical_tables<'life0, 'life1, 'async_trait>(
        &'life0 self,
        _query: &'life1 str,
        _query_ctx: QueryContextRef,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<Output>>> + Send + 'async_trait>>
       where Self: Sync + 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait { ... }
}

Required Methods§

Source

fn do_query<'life0, 'life1, 'async_trait>( &'life0 self, query: &'life1 str, query_ctx: QueryContextRef, ) -> Pin<Box<dyn Future<Output = Vec<Result<Output>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source

fn do_analyze_stream_query<'life0, 'life1, 'async_trait>( &'life0 self, query: &'life1 str, query_ctx: QueryContextRef, ) -> Pin<Box<dyn Future<Output = Result<Output>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Executes an HTTP analyze-stream query.

Implementations must validate that query is exactly one supported SQL EXPLAIN ANALYZE VERBOSE or TQL TQL ANALYZE VERBOSE statement and must return a streaming output. OutputMeta.plan is used by the HTTP layer to emit metrics snapshots; when it is absent, partial metrics may not be available. The returned stream should support cancel-on-drop semantics (as the production frontend implementation does) so client disconnect can best-effort cancel the underlying query.

Source

fn do_exec_plan<'life0, 'async_trait>( &'life0 self, plan: LogicalPlan, stmt: Option<Statement>, query_ctx: QueryContextRef, ) -> Pin<Box<dyn Future<Output = Result<Output>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source

fn do_promql_query<'life0, 'life1, 'async_trait>( &'life0 self, query: &'life1 PromQuery, query_ctx: QueryContextRef, ) -> Pin<Box<dyn Future<Output = Vec<Result<Output>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source

fn do_describe<'life0, 'async_trait>( &'life0 self, stmt: Statement, query_ctx: QueryContextRef, ) -> Pin<Box<dyn Future<Output = Result<Option<DescribeResult>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source

fn is_valid_schema<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, catalog: &'life1 str, schema: &'life2 str, ) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Provided Methods§

Source

fn supports_metric_batch_ddl(&self) -> bool

Whether this handler implements the bounded logical-table DDL operation.

Source

fn create_logical_tables<'life0, 'life1, 'async_trait>( &'life0 self, _query: &'life1 str, _query_ctx: QueryContextRef, ) -> Pin<Box<dyn Future<Output = Result<Vec<Output>>> + Send + 'async_trait>>
where Self: Sync + 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Validates and authorizes the whole batch before submitting one procedure.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§