pgwire::pg_server

Trait SessionManager

source
pub trait SessionManager:
    Send
    + Sync
    + 'static {
    type Session: Session;

    // Required methods
    fn create_dummy_session(
        &self,
        database_id: u32,
        user_id: u32,
    ) -> Result<Arc<Self::Session>, BoxedError>;
    fn connect(
        &self,
        database: &str,
        user_name: &str,
        peer_addr: AddressRef,
    ) -> Result<Arc<Self::Session>, BoxedError>;
    fn cancel_queries_in_session(&self, session_id: SessionId);
    fn cancel_creating_jobs_in_session(&self, session_id: SessionId);
    fn end_session(&self, session: &Self::Session);

    // Provided method
    fn shutdown(&self) -> impl Future<Output = ()> + Send { ... }
}
Expand description

The interface for a database system behind pgwire protocol. We can mock it for testing purpose.

Required Associated Types§

Required Methods§

source

fn create_dummy_session( &self, database_id: u32, user_id: u32, ) -> Result<Arc<Self::Session>, BoxedError>

In the process of auto schema change, we need a dummy session to access catalog information in frontend and build a replace plan for the table.

source

fn connect( &self, database: &str, user_name: &str, peer_addr: AddressRef, ) -> Result<Arc<Self::Session>, BoxedError>

source

fn cancel_queries_in_session(&self, session_id: SessionId)

source

fn cancel_creating_jobs_in_session(&self, session_id: SessionId)

source

fn end_session(&self, session: &Self::Session)

Provided Methods§

source

fn shutdown(&self) -> impl Future<Output = ()> + Send

Run some cleanup tasks before the server shutdown.

Object Safety§

This trait is not object safe.

Implementors§