Skip to content

Commit f7b2d76

Browse files
committed
Add a state method to Pool
This is needed on master
1 parent aa792fb commit f7b2d76

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/db.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,13 @@ impl DieselPool {
2525
}
2626
}
2727

28+
pub fn state(&self) -> r2d2::State {
29+
match self {
30+
DieselPool::Pool(pool) => pool.state(),
31+
DieselPool::Test(_) => panic!("Cannot get the state of a test pool"),
32+
}
33+
}
34+
2835
fn test_conn(conn: PgConnection) -> Self {
2936
DieselPool::Test(ReentrantMutex::new(conn))
3037
}

0 commit comments

Comments
 (0)