MCPcopy Create free account
hub / github.com/chirpstack/chirpstack / get_async_db_pool

Function get_async_db_pool

chirpstack/src/storage/sqlite.rs:75–82  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

73}
74
75fn get_async_db_pool() -> Result<AsyncSqlitePool> {
76 let pool_r = ASYNC_SQLITE_POOL.read().unwrap();
77 let pool: AsyncSqlitePool = pool_r
78 .as_ref()
79 .ok_or_else(|| anyhow!("SQLite connection pool is not initialized"))?
80 .clone();
81 Ok(pool)
82}
83
84pub async fn get_async_db_conn() -> Result<AsyncSqlitePoolConnection> {
85 let pool = get_async_db_pool()?;

Callers 1

get_async_db_connFunction · 0.70

Calls 2

unwrapMethod · 0.80
as_refMethod · 0.80

Tested by

no test coverage detected