pub struct ConnectionResetExecutor { /* private fields */ }Expand description
Connection reset executor
Executes reset queries to clear session state before returning connections to the pool.
Implementations§
Source§impl ConnectionResetExecutor
impl ConnectionResetExecutor
Sourcepub fn new(reset_query: impl Into<String>) -> Self
pub fn new(reset_query: impl Into<String>) -> Self
Create a new reset executor with the given query
Sourcepub fn with_commands(commands: Vec<String>) -> Self
pub fn with_commands(commands: Vec<String>) -> Self
Create a reset executor with multiple commands
Sourcepub fn add_command(&mut self, command: impl Into<String>)
pub fn add_command(&mut self, command: impl Into<String>)
Add a custom reset command
Sourcepub fn reset_queries(&self) -> Vec<&str>
pub fn reset_queries(&self) -> Vec<&str>
Get the reset query (or queries)
Sourcepub fn uses_discard_all(&self) -> bool
pub fn uses_discard_all(&self) -> bool
Check if using DISCARD ALL
Sourcepub fn build_reset_sql(&self) -> String
pub fn build_reset_sql(&self) -> String
Build the complete reset SQL (for protocols that support multi-statement)
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ConnectionResetExecutor
impl RefUnwindSafe for ConnectionResetExecutor
impl Send for ConnectionResetExecutor
impl Sync for ConnectionResetExecutor
impl Unpin for ConnectionResetExecutor
impl UnsafeUnpin for ConnectionResetExecutor
impl UnwindSafe for ConnectionResetExecutor
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more