Skip to content

Commit e33d23e

Browse files
committed
feat(pool): add more info to impl Debug for PoolConnection
1 parent 3ab3029 commit e33d23e

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

sqlx-core/src/pool/connection.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,10 @@ const EXPECT_MSG: &str = "BUG: inner connection already taken!";
4848

4949
impl<DB: Database> Debug for PoolConnection<DB> {
5050
fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result {
51-
// TODO: Show the type name of the connection ?
52-
f.debug_struct("PoolConnection").finish()
51+
f.debug_struct("PoolConnection")
52+
.field("database", &DB::NAME)
53+
.field("id", &self.live.as_ref().map(|live| live.id))
54+
.finish()
5355
}
5456
}
5557

0 commit comments

Comments
 (0)