Skip to main content

SessionManager

Trait SessionManager 

Source
pub trait SessionManager:
    Send
    + Sync
    + 'static {
    type Error: Into<BoxedError>;
    type Session: Session<Error = Self::Error>;

    // Required methods
    fn create_dummy_session(
        &self,
        database_id: DatabaseId,
    ) -> Result<Arc<Self::Session>, Self::Error>;
    fn connect(
        &self,
        database: &str,
        user_name: &str,
        peer_addr: AddressRef,
    ) -> Result<Arc<Self::Session>, Self::Error>;
    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: DatabaseId, ) -> Result<Arc<Self::Session>, Self::Error>

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>, Self::Error>

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.

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§