From 44a35e651741afb6c417da47d636e4380cdd225f Mon Sep 17 00:00:00 2001 From: Santo Cariotti Date: Sat, 13 Mar 2021 10:17:02 +0100 Subject: feat: add get all repos from db --- src/db.rs | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 src/db.rs (limited to 'src/db.rs') diff --git a/src/db.rs b/src/db.rs new file mode 100644 index 0000000..f547ab2 --- /dev/null +++ b/src/db.rs @@ -0,0 +1,8 @@ +use crate::errors::AppError; +use deadpool_postgres::{Client, Pool, PoolError}; + +pub async fn get_client(pool: Pool) -> Result { + pool.get() + .await + .map_err(|err: PoolError| AppError::from(err)) +} -- cgit v1.2.3-18-g5258