Skip to content

Commit

Permalink
feat(pool): add more info to impl Debug for PoolConnection
Browse files Browse the repository at this point in the history
  • Loading branch information
abonander committed Nov 8, 2024
1 parent 3ab3029 commit 13d1c01
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions sqlx-core/src/pool/connection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,11 @@ const EXPECT_MSG: &str = "BUG: inner connection already taken!";

impl<DB: Database> Debug for PoolConnection<DB> {
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()
}
}

Expand Down

0 comments on commit 13d1c01

Please sign in to comment.