pub struct SqlBridge { /* private fields */ }Expand description
Bridges ConnectionPool to khive_storage::SqlAccess.
Dispatches based on whether the pool is file-backed or in-memory:
- File-backed: standalone connections per reader/writer call (high concurrency); atomic units drive a single registered raw transaction span instead of a caller-held per-tx connection.
- In-memory: pool-backed connections per query (single shared connection).
Implementations§
Trait Implementations§
Source§impl SqlAccess for SqlBridge
impl SqlAccess for SqlBridge
Source§fn atomic_unit<'life0, 'async_trait>(
&'life0 self,
op: AtomicUnitOp,
) -> Pin<Box<dyn Future<Output = StorageResult<Box<dyn Any + Send>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn atomic_unit<'life0, 'async_trait>(
&'life0 self,
op: AtomicUnitOp,
) -> Pin<Box<dyn Future<Output = StorageResult<Box<dyn Any + Send>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Implements the trait’s atomic-unit suspend-free invariant
(SqlAccess::atomic_unit’s doc comment): on the flag-on branch below,
op is driven through block_on_sync on an InlineWriter — a
single-poll driver that returns Err the instant op’s future is
Pending instead of ever actually suspending. op must therefore
issue only synchronous DML; see InlineWriter’s and
block_on_sync’s doc comments for the full mechanics and why this
restriction is load-bearing (a suspended poll inside the writer
task’s spawn_blocking would otherwise block that task on external
async work while holding the single write connection).
Auto Trait Implementations§
impl !RefUnwindSafe for SqlBridge
impl !UnwindSafe for SqlBridge
impl Freeze for SqlBridge
impl Send for SqlBridge
impl Sync for SqlBridge
impl Unpin for SqlBridge
impl UnsafeUnpin for SqlBridge
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