Trait pgwire::api::query::SimpleQueryHandler

source ·
pub trait SimpleQueryHandler: Send + Sync {
    // Required method
    fn do_query<'a, 'b, 'life0, 'async_trait, C>(
        &'b self,
        client: &'life0 mut C,
        query: &'a str,
    ) -> Pin<Box<dyn Future<Output = PgWireResult<Vec<Response<'a>>>> + Send + 'async_trait>>
       where C: ClientInfo + Sink<PgWireBackendMessage> + Unpin + Send + Sync + 'async_trait,
             C::Error: Debug,
             PgWireError: From<<C as Sink<PgWireBackendMessage>>::Error>,
             Self: 'async_trait,
             'a: 'async_trait,
             'b: 'async_trait + 'a,
             'life0: 'async_trait;

    // Provided method
    fn on_query<'life0, 'life1, 'async_trait, C>(
        &'life0 self,
        client: &'life1 mut C,
        query: Query,
    ) -> Pin<Box<dyn Future<Output = PgWireResult<()>> + Send + 'async_trait>>
       where C: ClientInfo + Sink<PgWireBackendMessage> + Unpin + Send + Sync + 'async_trait,
             C::Error: Debug,
             PgWireError: From<<C as Sink<PgWireBackendMessage>>::Error>,
             Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait { ... }
}
Expand description

handler for processing simple query.

Required Methods§

source

fn do_query<'a, 'b, 'life0, 'async_trait, C>( &'b self, client: &'life0 mut C, query: &'a str, ) -> Pin<Box<dyn Future<Output = PgWireResult<Vec<Response<'a>>>> + Send + 'async_trait>>
where C: ClientInfo + Sink<PgWireBackendMessage> + Unpin + Send + Sync + 'async_trait, C::Error: Debug, PgWireError: From<<C as Sink<PgWireBackendMessage>>::Error>, Self: 'async_trait, 'a: 'async_trait, 'b: 'async_trait + 'a, 'life0: 'async_trait,

Provide your query implementation using the incoming query string.

Provided Methods§

source

fn on_query<'life0, 'life1, 'async_trait, C>( &'life0 self, client: &'life1 mut C, query: Query, ) -> Pin<Box<dyn Future<Output = PgWireResult<()>> + Send + 'async_trait>>
where C: ClientInfo + Sink<PgWireBackendMessage> + Unpin + Send + Sync + 'async_trait, C::Error: Debug, PgWireError: From<<C as Sink<PgWireBackendMessage>>::Error>, Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Executed on Query request arrived. This is how postgres respond to simple query. The default implementation calls do_query with the incoming query string.

This handle checks empty query by default, if the query string is empty or ;, it returns EmptyQueryResponse and does not call self.do_query.

Object Safety§

This trait is not object safe.

Implementors§