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 e33d23e
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions sqlx-core/src/pool/connection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,10 @@ 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 e33d23e

Please sign in to comment.