From e33d23e818bb648a2c30ce4de7b1038ff2f618f2 Mon Sep 17 00:00:00 2001 From: Austin Bonander Date: Fri, 8 Nov 2024 15:52:53 -0800 Subject: [PATCH] feat(pool): add more info to `impl Debug for PoolConnection` --- sqlx-core/src/pool/connection.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/sqlx-core/src/pool/connection.rs b/sqlx-core/src/pool/connection.rs index 1b68b76757..ac26437b4c 100644 --- a/sqlx-core/src/pool/connection.rs +++ b/sqlx-core/src/pool/connection.rs @@ -48,8 +48,10 @@ const EXPECT_MSG: &str = "BUG: inner connection already taken!"; impl Debug for PoolConnection { fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result { - // TODO: Show the type name of the connection ? - f.debug_struct("PoolConnection").finish() + f.debug_struct("PoolConnection") + .field("database", &DB::NAME) + .field("id", &self.live.as_ref().map(|live| live.id)) + .finish() } }