MCPcopy Create free account
hub / github.com/erans/pgsqlite / with_cached_connection

Method with_cached_connection

src/session/db_handler.rs:2597–2606  ·  view source on GitHub ↗

Execute with a cached connection (fast path - no HashMap lookup)

(
        &self,
        cached_conn: &Arc<parking_lot::Mutex<rusqlite::Connection>>,
        f: F
    )

Source from the content-addressed store, hash-verified

2595
2596 /// Execute with a cached connection (fast path - no HashMap lookup)
2597 pub async fn with_cached_connection<F, R>(
2598 &self,
2599 cached_conn: &Arc<parking_lot::Mutex<rusqlite::Connection>>,
2600 f: F
2601 ) -> Result<R, PgSqliteError>
2602 where
2603 F: FnOnce(&rusqlite::Connection) -> Result<R, rusqlite::Error>
2604 {
2605 self.connection_manager.execute_with_cached_connection(cached_conn, f)
2606 }
2607
2608 /// Execute with a mutable cached connection (fast path - no HashMap lookup)
2609 pub async fn with_cached_connection_mut<F, R>(

Callers

nothing calls this directly

Calls 1

Tested by

no test coverage detected