()
| 73 | } |
| 74 | |
| 75 | fn 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 | |
| 84 | pub async fn get_async_db_conn() -> Result<AsyncSqlitePoolConnection> { |
| 85 | let pool = get_async_db_pool()?; |
no test coverage detected