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/tx (high concurrency).
- In-memory: pool-backed connections per query (single shared connection).
Implementations§
Trait Implementations§
Source§impl SqlAccess for SqlBridge
impl SqlAccess for SqlBridge
Source§fn reader<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = StorageResult<Box<dyn SqlReader>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn reader<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = StorageResult<Box<dyn SqlReader>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Acquire a read-only connection from the pool.
Source§fn writer<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = StorageResult<Box<dyn SqlWriter>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn writer<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = StorageResult<Box<dyn SqlWriter>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Acquire a read-write connection from the pool.
Source§fn begin_tx<'life0, 'async_trait>(
&'life0 self,
options: SqlTxOptions,
) -> Pin<Box<dyn Future<Output = StorageResult<Box<dyn SqlTransaction>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn begin_tx<'life0, 'async_trait>(
&'life0 self,
options: SqlTxOptions,
) -> Pin<Box<dyn Future<Output = StorageResult<Box<dyn SqlTransaction>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Begin a transaction with the given isolation options.
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