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: pooled ordinary reader operations and a lazy standalone connection only for explicitly admitted multi-call read transactions, plus standalone writer connections capped at one live handle; atomic units drive a single registered raw transaction span.
- 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 queued and in-memory branches,
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).
Source§fn database_path(&self) -> Option<PathBuf>
fn database_path(&self) -> Option<PathBuf>
Canonical filesystem identity for this SQL database, when file-backed. Read more
Auto Trait Implementations§
impl !RefUnwindSafe for SqlBridge
impl !UnwindSafe for SqlBridge
impl Forget for SqlBridge
impl Freeze for SqlBridgewhere
*const ArcInner<ConnectionPool> is !null: Freeze,
PhantomData<ArcInner<ConnectionPool>>: Freeze,
impl Move for SqlBridge
impl Send for SqlBridge
impl Sync for SqlBridge
impl Unpin for SqlBridge
impl UnsafeUnpin for SqlBridgewhere
*const ArcInner<ConnectionPool> is !null: UnsafeUnpin,
PhantomData<ArcInner<ConnectionPool>>: UnsafeUnpin,
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