pub struct ConnectionSession<C: Connection> { /* private fields */ }Expand description
A database session that combines connection management with optional console output.
This type is a lightweight wrapper around a Connection and optional console.
For ORM-style behavior (identity map, unit of work, lazy loading), use
sqlmodel::Session (from sqlmodel-session).
Implementations§
Source§impl<C: Connection> ConnectionSession<C>
impl<C: Connection> ConnectionSession<C>
Sourcepub fn builder() -> ConnectionSessionBuilder<C>
pub fn builder() -> ConnectionSessionBuilder<C>
Create a session builder.
Sourcepub fn connection(&self) -> &C
pub fn connection(&self) -> &C
Get a reference to the underlying connection.
Sourcepub fn connection_mut(&mut self) -> &mut C
pub fn connection_mut(&mut self) -> &mut C
Get a mutable reference to the underlying connection.
Sourcepub fn into_connection(self) -> C
pub fn into_connection(self) -> C
Consume the session and return the underlying connection.
Trait Implementations§
Auto Trait Implementations§
impl<C> Freeze for ConnectionSession<C>where
C: Freeze,
impl<C> RefUnwindSafe for ConnectionSession<C>where
C: RefUnwindSafe,
impl<C> Send for ConnectionSession<C>
impl<C> Sync for ConnectionSession<C>
impl<C> Unpin for ConnectionSession<C>where
C: Unpin,
impl<C> UnsafeUnpin for ConnectionSession<C>where
C: UnsafeUnpin,
impl<C> UnwindSafe for ConnectionSession<C>where
C: UnwindSafe,
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: NoopSpan) -> Self
fn instrument(self, _span: NoopSpan) -> Self
Instruments this future with a span (no-op when disabled).
Source§fn in_current_span(self) -> Self
fn in_current_span(self) -> Self
Instruments this future with the current span (no-op when disabled).