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§
sourcefn create_dummy_session(
&self,
database_id: u32,
user_id: u32,
) -> Result<Arc<Self::Session>, BoxedError>
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.
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 Methods§
Object Safety§
This trait is not object safe.